Kea 2.7.5
dhcp4_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 parser4_lex
40
41
42
43#include "dhcp4_parser.h"
44
45
46// Unqualified %code blocks.
47#line 34 "dhcp4_parser.yy"
48
50
51// Avoid warnings with the error counter.
52#if defined(__GNUC__) || defined(__clang__)
53#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
54#endif
55
56#line 57 "dhcp4_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 PARSER4_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 // !PARSER4_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 // !PARSER4_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 "dhcp4_parser.yy"
148namespace isc { namespace dhcp {
149#line 150 "dhcp4_parser.cc"
150
153#if PARSER4_DEBUG
154 : yydebug_ (false),
155 yycdebug_ (&std::cerr),
156#else
157 :
158#endif
159 ctx (ctx_yyarg)
160 {}
161
164
167
168 /*---------.
169 | symbol. |
170 `---------*/
171
172
173
174 // by_state.
175 Dhcp4Parser::by_state::by_state () YY_NOEXCEPT
176 : state (empty_state)
177 {}
178
179 Dhcp4Parser::by_state::by_state (const by_state& that) YY_NOEXCEPT
180 : state (that.state)
181 {}
182
183 void
184 Dhcp4Parser::by_state::clear () YY_NOEXCEPT
185 {
186 state = empty_state;
187 }
188
189 void
190 Dhcp4Parser::by_state::move (by_state& that)
191 {
192 state = that.state;
193 that.clear ();
194 }
195
196 Dhcp4Parser::by_state::by_state (state_type s) YY_NOEXCEPT
197 : state (s)
198 {}
199
201 Dhcp4Parser::by_state::kind () const YY_NOEXCEPT
202 {
203 if (state == empty_state)
205 else
206 return YY_CAST (symbol_kind_type, yystos_[+state]);
207 }
208
209 Dhcp4Parser::stack_symbol_type::stack_symbol_type ()
210 {}
211
212 Dhcp4Parser::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_ddns_replace_client_name_value: // ddns_replace_client_name_value
220 case symbol_kind::S_ddns_conflict_resolution_mode_value: // ddns_conflict_resolution_mode_value
221 case symbol_kind::S_socket_type: // socket_type
222 case symbol_kind::S_outbound_interface_value: // outbound_interface_value
223 case symbol_kind::S_on_fail_mode: // on_fail_mode
224 case symbol_kind::S_control_socket_type_value: // control_socket_type_value
225 case symbol_kind::S_auth_type_value: // auth_type_value
226 case symbol_kind::S_ncr_protocol_value: // ncr_protocol_value
227 value.YY_MOVE_OR_COPY< ElementPtr > (YY_MOVE (that.value));
228 break;
229
230 case symbol_kind::S_BOOLEAN: // "boolean"
231 value.YY_MOVE_OR_COPY< bool > (YY_MOVE (that.value));
232 break;
233
234 case symbol_kind::S_FLOAT: // "floating point"
235 value.YY_MOVE_OR_COPY< double > (YY_MOVE (that.value));
236 break;
237
238 case symbol_kind::S_INTEGER: // "integer"
239 value.YY_MOVE_OR_COPY< int64_t > (YY_MOVE (that.value));
240 break;
241
242 case symbol_kind::S_STRING: // "constant string"
243 value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value));
244 break;
245
246 default:
247 break;
248 }
249
250#if 201103L <= YY_CPLUSPLUS
251 // that is emptied.
252 that.state = empty_state;
253#endif
254 }
255
256 Dhcp4Parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that)
257 : super_type (s, YY_MOVE (that.location))
258 {
259 switch (that.kind ())
260 {
261 case symbol_kind::S_value: // value
262 case symbol_kind::S_map_value: // map_value
263 case symbol_kind::S_ddns_replace_client_name_value: // ddns_replace_client_name_value
264 case symbol_kind::S_ddns_conflict_resolution_mode_value: // ddns_conflict_resolution_mode_value
265 case symbol_kind::S_socket_type: // socket_type
266 case symbol_kind::S_outbound_interface_value: // outbound_interface_value
267 case symbol_kind::S_on_fail_mode: // on_fail_mode
268 case symbol_kind::S_control_socket_type_value: // control_socket_type_value
269 case symbol_kind::S_auth_type_value: // auth_type_value
270 case symbol_kind::S_ncr_protocol_value: // ncr_protocol_value
271 value.move< ElementPtr > (YY_MOVE (that.value));
272 break;
273
274 case symbol_kind::S_BOOLEAN: // "boolean"
275 value.move< bool > (YY_MOVE (that.value));
276 break;
277
278 case symbol_kind::S_FLOAT: // "floating point"
279 value.move< double > (YY_MOVE (that.value));
280 break;
281
282 case symbol_kind::S_INTEGER: // "integer"
283 value.move< int64_t > (YY_MOVE (that.value));
284 break;
285
286 case symbol_kind::S_STRING: // "constant string"
287 value.move< std::string > (YY_MOVE (that.value));
288 break;
289
290 default:
291 break;
292 }
293
294 // that is emptied.
295 that.kind_ = symbol_kind::S_YYEMPTY;
296 }
297
298#if YY_CPLUSPLUS < 201103L
299 Dhcp4Parser::stack_symbol_type&
300 Dhcp4Parser::stack_symbol_type::operator= (const stack_symbol_type& that)
301 {
302 state = that.state;
303 switch (that.kind ())
304 {
305 case symbol_kind::S_value: // value
306 case symbol_kind::S_map_value: // map_value
307 case symbol_kind::S_ddns_replace_client_name_value: // ddns_replace_client_name_value
308 case symbol_kind::S_ddns_conflict_resolution_mode_value: // ddns_conflict_resolution_mode_value
309 case symbol_kind::S_socket_type: // socket_type
310 case symbol_kind::S_outbound_interface_value: // outbound_interface_value
311 case symbol_kind::S_on_fail_mode: // on_fail_mode
312 case symbol_kind::S_control_socket_type_value: // control_socket_type_value
313 case symbol_kind::S_auth_type_value: // auth_type_value
314 case symbol_kind::S_ncr_protocol_value: // ncr_protocol_value
315 value.copy< ElementPtr > (that.value);
316 break;
317
318 case symbol_kind::S_BOOLEAN: // "boolean"
319 value.copy< bool > (that.value);
320 break;
321
322 case symbol_kind::S_FLOAT: // "floating point"
323 value.copy< double > (that.value);
324 break;
325
326 case symbol_kind::S_INTEGER: // "integer"
327 value.copy< int64_t > (that.value);
328 break;
329
330 case symbol_kind::S_STRING: // "constant string"
331 value.copy< std::string > (that.value);
332 break;
333
334 default:
335 break;
336 }
337
338 location = that.location;
339 return *this;
340 }
341
342 Dhcp4Parser::stack_symbol_type&
343 Dhcp4Parser::stack_symbol_type::operator= (stack_symbol_type& that)
344 {
345 state = that.state;
346 switch (that.kind ())
347 {
348 case symbol_kind::S_value: // value
349 case symbol_kind::S_map_value: // map_value
350 case symbol_kind::S_ddns_replace_client_name_value: // ddns_replace_client_name_value
351 case symbol_kind::S_ddns_conflict_resolution_mode_value: // ddns_conflict_resolution_mode_value
352 case symbol_kind::S_socket_type: // socket_type
353 case symbol_kind::S_outbound_interface_value: // outbound_interface_value
354 case symbol_kind::S_on_fail_mode: // on_fail_mode
355 case symbol_kind::S_control_socket_type_value: // control_socket_type_value
356 case symbol_kind::S_auth_type_value: // auth_type_value
357 case symbol_kind::S_ncr_protocol_value: // ncr_protocol_value
358 value.move< ElementPtr > (that.value);
359 break;
360
361 case symbol_kind::S_BOOLEAN: // "boolean"
362 value.move< bool > (that.value);
363 break;
364
365 case symbol_kind::S_FLOAT: // "floating point"
366 value.move< double > (that.value);
367 break;
368
369 case symbol_kind::S_INTEGER: // "integer"
370 value.move< int64_t > (that.value);
371 break;
372
373 case symbol_kind::S_STRING: // "constant string"
374 value.move< std::string > (that.value);
375 break;
376
377 default:
378 break;
379 }
380
381 location = that.location;
382 // that is emptied.
383 that.state = empty_state;
384 return *this;
385 }
386#endif
387
388 template <typename Base>
389 void
390 Dhcp4Parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
391 {
392 if (yymsg)
393 YY_SYMBOL_PRINT (yymsg, yysym);
394 }
395
396#if PARSER4_DEBUG
397 template <typename Base>
398 void
399 Dhcp4Parser::yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const
400 {
401 std::ostream& yyoutput = yyo;
402 YY_USE (yyoutput);
403 if (yysym.empty ())
404 yyo << "empty symbol";
405 else
406 {
407 symbol_kind_type yykind = yysym.kind ();
408 yyo << (yykind < YYNTOKENS ? "token" : "nterm")
409 << ' ' << yysym.name () << " ("
410 << yysym.location << ": ";
411 switch (yykind)
412 {
413 case symbol_kind::S_STRING: // "constant string"
414#line 317 "dhcp4_parser.yy"
415 { yyoutput << yysym.value.template as < std::string > (); }
416#line 417 "dhcp4_parser.cc"
417 break;
418
419 case symbol_kind::S_INTEGER: // "integer"
420#line 317 "dhcp4_parser.yy"
421 { yyoutput << yysym.value.template as < int64_t > (); }
422#line 423 "dhcp4_parser.cc"
423 break;
424
425 case symbol_kind::S_FLOAT: // "floating point"
426#line 317 "dhcp4_parser.yy"
427 { yyoutput << yysym.value.template as < double > (); }
428#line 429 "dhcp4_parser.cc"
429 break;
430
431 case symbol_kind::S_BOOLEAN: // "boolean"
432#line 317 "dhcp4_parser.yy"
433 { yyoutput << yysym.value.template as < bool > (); }
434#line 435 "dhcp4_parser.cc"
435 break;
436
437 case symbol_kind::S_value: // value
438#line 317 "dhcp4_parser.yy"
439 { yyoutput << yysym.value.template as < ElementPtr > (); }
440#line 441 "dhcp4_parser.cc"
441 break;
442
443 case symbol_kind::S_map_value: // map_value
444#line 317 "dhcp4_parser.yy"
445 { yyoutput << yysym.value.template as < ElementPtr > (); }
446#line 447 "dhcp4_parser.cc"
447 break;
448
449 case symbol_kind::S_ddns_replace_client_name_value: // ddns_replace_client_name_value
450#line 317 "dhcp4_parser.yy"
451 { yyoutput << yysym.value.template as < ElementPtr > (); }
452#line 453 "dhcp4_parser.cc"
453 break;
454
455 case symbol_kind::S_ddns_conflict_resolution_mode_value: // ddns_conflict_resolution_mode_value
456#line 317 "dhcp4_parser.yy"
457 { yyoutput << yysym.value.template as < ElementPtr > (); }
458#line 459 "dhcp4_parser.cc"
459 break;
460
461 case symbol_kind::S_socket_type: // socket_type
462#line 317 "dhcp4_parser.yy"
463 { yyoutput << yysym.value.template as < ElementPtr > (); }
464#line 465 "dhcp4_parser.cc"
465 break;
466
467 case symbol_kind::S_outbound_interface_value: // outbound_interface_value
468#line 317 "dhcp4_parser.yy"
469 { yyoutput << yysym.value.template as < ElementPtr > (); }
470#line 471 "dhcp4_parser.cc"
471 break;
472
473 case symbol_kind::S_on_fail_mode: // on_fail_mode
474#line 317 "dhcp4_parser.yy"
475 { yyoutput << yysym.value.template as < ElementPtr > (); }
476#line 477 "dhcp4_parser.cc"
477 break;
478
479 case symbol_kind::S_control_socket_type_value: // control_socket_type_value
480#line 317 "dhcp4_parser.yy"
481 { yyoutput << yysym.value.template as < ElementPtr > (); }
482#line 483 "dhcp4_parser.cc"
483 break;
484
485 case symbol_kind::S_auth_type_value: // auth_type_value
486#line 317 "dhcp4_parser.yy"
487 { yyoutput << yysym.value.template as < ElementPtr > (); }
488#line 489 "dhcp4_parser.cc"
489 break;
490
491 case symbol_kind::S_ncr_protocol_value: // ncr_protocol_value
492#line 317 "dhcp4_parser.yy"
493 { yyoutput << yysym.value.template as < ElementPtr > (); }
494#line 495 "dhcp4_parser.cc"
495 break;
496
497 default:
498 break;
499 }
500 yyo << ')';
501 }
502 }
503#endif
504
505 void
506 Dhcp4Parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym)
507 {
508 if (m)
509 YY_SYMBOL_PRINT (m, sym);
510 yystack_.push (YY_MOVE (sym));
511 }
512
513 void
514 Dhcp4Parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
515 {
516#if 201103L <= YY_CPLUSPLUS
517 yypush_ (m, stack_symbol_type (s, std::move (sym)));
518#else
519 stack_symbol_type ss (s, sym);
520 yypush_ (m, ss);
521#endif
522 }
523
524 void
525 Dhcp4Parser::yypop_ (int n) YY_NOEXCEPT
526 {
527 yystack_.pop (n);
528 }
529
530#if PARSER4_DEBUG
531 std::ostream&
532 Dhcp4Parser::debug_stream () const
533 {
534 return *yycdebug_;
535 }
536
537 void
538 Dhcp4Parser::set_debug_stream (std::ostream& o)
539 {
540 yycdebug_ = &o;
541 }
542
543
544 Dhcp4Parser::debug_level_type
545 Dhcp4Parser::debug_level () const
546 {
547 return yydebug_;
548 }
549
550 void
551 Dhcp4Parser::set_debug_level (debug_level_type l)
552 {
553 yydebug_ = l;
554 }
555#endif // PARSER4_DEBUG
556
557 Dhcp4Parser::state_type
558 Dhcp4Parser::yy_lr_goto_state_ (state_type yystate, int yysym)
559 {
560 int yyr = yypgoto_[yysym - YYNTOKENS] + yystate;
561 if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
562 return yytable_[yyr];
563 else
564 return yydefgoto_[yysym - YYNTOKENS];
565 }
566
567 bool
568 Dhcp4Parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT
569 {
570 return yyvalue == yypact_ninf_;
571 }
572
573 bool
574 Dhcp4Parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT
575 {
576 return yyvalue == yytable_ninf_;
577 }
578
579 int
581 {
582 return parse ();
583 }
584
585 int
587 {
588 int yyn;
590 int yylen = 0;
591
592 // Error handling.
593 int yynerrs_ = 0;
594 int yyerrstatus_ = 0;
595
597 symbol_type yyla;
598
600 stack_symbol_type yyerror_range[3];
601
603 int yyresult;
604
605#if YY_EXCEPTIONS
606 try
607#endif // YY_EXCEPTIONS
608 {
609 YYCDEBUG << "Starting parse\n";
610
611
612 /* Initialize the stack. The initial state will be set in
613 yynewstate, since the latter expects the semantical and the
614 location values to have been already stored, initialize these
615 stacks with a primary value. */
616 yystack_.clear ();
617 yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla));
618
619 /*-----------------------------------------------.
620 | yynewstate -- push a new symbol on the stack. |
621 `-----------------------------------------------*/
622 yynewstate:
623 YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n';
625
626 // Accept?
627 if (yystack_[0].state == yyfinal_)
628 YYACCEPT;
629
630 goto yybackup;
631
632
633 /*-----------.
634 | yybackup. |
635 `-----------*/
636 yybackup:
637 // Try to take a decision without lookahead.
638 yyn = yypact_[+yystack_[0].state];
639 if (yy_pact_value_is_default_ (yyn))
640 goto yydefault;
641
642 // Read a lookahead token.
643 if (yyla.empty ())
644 {
645 YYCDEBUG << "Reading a token\n";
646#if YY_EXCEPTIONS
647 try
648#endif // YY_EXCEPTIONS
649 {
650 symbol_type yylookahead (yylex (ctx));
651 yyla.move (yylookahead);
652 }
653#if YY_EXCEPTIONS
654 catch (const syntax_error& yyexc)
655 {
656 YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
657 error (yyexc);
658 goto yyerrlab1;
659 }
660#endif // YY_EXCEPTIONS
661 }
662 YY_SYMBOL_PRINT ("Next token is", yyla);
663
664 if (yyla.kind () == symbol_kind::S_YYerror)
665 {
666 // The scanner already issued an error message, process directly
667 // to error recovery. But do not keep the error token as
668 // lookahead, it is too special and may lead us to an endless
669 // loop in error recovery. */
670 yyla.kind_ = symbol_kind::S_YYUNDEF;
671 goto yyerrlab1;
672 }
673
674 /* If the proper action on seeing token YYLA.TYPE is to reduce or
675 to detect an error, take that action. */
676 yyn += yyla.kind ();
677 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ())
678 {
679 goto yydefault;
680 }
681
682 // Reduce or error.
683 yyn = yytable_[yyn];
684 if (yyn <= 0)
685 {
686 if (yy_table_value_is_error_ (yyn))
687 goto yyerrlab;
688 yyn = -yyn;
689 goto yyreduce;
690 }
691
692 // Count tokens shifted since error; after three, turn off error status.
693 if (yyerrstatus_)
694 --yyerrstatus_;
695
696 // Shift the lookahead token.
697 yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla));
698 goto yynewstate;
699
700
701 /*-----------------------------------------------------------.
702 | yydefault -- do the default action for the current state. |
703 `-----------------------------------------------------------*/
704 yydefault:
705 yyn = yydefact_[+yystack_[0].state];
706 if (yyn == 0)
707 goto yyerrlab;
708 goto yyreduce;
709
710
711 /*-----------------------------.
712 | yyreduce -- do a reduction. |
713 `-----------------------------*/
714 yyreduce:
715 yylen = yyr2_[yyn];
716 {
717 stack_symbol_type yylhs;
718 yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);
719 /* Variants are always initialized to an empty instance of the
720 correct type. The default '$$ = $1' action is NOT applied
721 when using variants. */
722 switch (yyr1_[yyn])
723 {
724 case symbol_kind::S_value: // value
725 case symbol_kind::S_map_value: // map_value
726 case symbol_kind::S_ddns_replace_client_name_value: // ddns_replace_client_name_value
727 case symbol_kind::S_ddns_conflict_resolution_mode_value: // ddns_conflict_resolution_mode_value
728 case symbol_kind::S_socket_type: // socket_type
729 case symbol_kind::S_outbound_interface_value: // outbound_interface_value
730 case symbol_kind::S_on_fail_mode: // on_fail_mode
731 case symbol_kind::S_control_socket_type_value: // control_socket_type_value
732 case symbol_kind::S_auth_type_value: // auth_type_value
733 case symbol_kind::S_ncr_protocol_value: // ncr_protocol_value
734 yylhs.value.emplace< ElementPtr > ();
735 break;
736
737 case symbol_kind::S_BOOLEAN: // "boolean"
738 yylhs.value.emplace< bool > ();
739 break;
740
741 case symbol_kind::S_FLOAT: // "floating point"
742 yylhs.value.emplace< double > ();
743 break;
744
745 case symbol_kind::S_INTEGER: // "integer"
746 yylhs.value.emplace< int64_t > ();
747 break;
748
749 case symbol_kind::S_STRING: // "constant string"
750 yylhs.value.emplace< std::string > ();
751 break;
752
753 default:
754 break;
755 }
756
757
758 // Default location.
759 {
760 stack_type::slice range (yystack_, yylen);
761 YYLLOC_DEFAULT (yylhs.location, range, yylen);
762 yyerror_range[1].location = yylhs.location;
763 }
764
765 // Perform the reduction.
766 YY_REDUCE_PRINT (yyn);
767#if YY_EXCEPTIONS
768 try
769#endif // YY_EXCEPTIONS
770 {
771 switch (yyn)
772 {
773 case 2: // $@1: %empty
774#line 326 "dhcp4_parser.yy"
775 { ctx.ctx_ = ctx.NO_KEYWORD; }
776#line 777 "dhcp4_parser.cc"
777 break;
778
779 case 4: // $@2: %empty
780#line 327 "dhcp4_parser.yy"
781 { ctx.ctx_ = ctx.CONFIG; }
782#line 783 "dhcp4_parser.cc"
783 break;
784
785 case 6: // $@3: %empty
786#line 328 "dhcp4_parser.yy"
787 { ctx.ctx_ = ctx.DHCP4; }
788#line 789 "dhcp4_parser.cc"
789 break;
790
791 case 8: // $@4: %empty
792#line 329 "dhcp4_parser.yy"
793 { ctx.ctx_ = ctx.INTERFACES_CONFIG; }
794#line 795 "dhcp4_parser.cc"
795 break;
796
797 case 10: // $@5: %empty
798#line 330 "dhcp4_parser.yy"
799 { ctx.ctx_ = ctx.SUBNET4; }
800#line 801 "dhcp4_parser.cc"
801 break;
802
803 case 12: // $@6: %empty
804#line 331 "dhcp4_parser.yy"
805 { ctx.ctx_ = ctx.POOLS; }
806#line 807 "dhcp4_parser.cc"
807 break;
808
809 case 14: // $@7: %empty
810#line 332 "dhcp4_parser.yy"
811 { ctx.ctx_ = ctx.RESERVATIONS; }
812#line 813 "dhcp4_parser.cc"
813 break;
814
815 case 16: // $@8: %empty
816#line 333 "dhcp4_parser.yy"
817 { ctx.ctx_ = ctx.DHCP4; }
818#line 819 "dhcp4_parser.cc"
819 break;
820
821 case 18: // $@9: %empty
822#line 334 "dhcp4_parser.yy"
823 { ctx.ctx_ = ctx.OPTION_DEF; }
824#line 825 "dhcp4_parser.cc"
825 break;
826
827 case 20: // $@10: %empty
828#line 335 "dhcp4_parser.yy"
829 { ctx.ctx_ = ctx.OPTION_DATA; }
830#line 831 "dhcp4_parser.cc"
831 break;
832
833 case 22: // $@11: %empty
834#line 336 "dhcp4_parser.yy"
835 { ctx.ctx_ = ctx.HOOKS_LIBRARIES; }
836#line 837 "dhcp4_parser.cc"
837 break;
838
839 case 24: // $@12: %empty
840#line 337 "dhcp4_parser.yy"
841 { ctx.ctx_ = ctx.DHCP_DDNS; }
842#line 843 "dhcp4_parser.cc"
843 break;
844
845 case 26: // $@13: %empty
846#line 338 "dhcp4_parser.yy"
847 { ctx.ctx_ = ctx.CONFIG_CONTROL; }
848#line 849 "dhcp4_parser.cc"
849 break;
850
851 case 28: // value: "integer"
852#line 346 "dhcp4_parser.yy"
853 { yylhs.value.as < ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location))); }
854#line 855 "dhcp4_parser.cc"
855 break;
856
857 case 29: // value: "floating point"
858#line 347 "dhcp4_parser.yy"
859 { yylhs.value.as < ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as < double > (), ctx.loc2pos(yystack_[0].location))); }
860#line 861 "dhcp4_parser.cc"
861 break;
862
863 case 30: // value: "boolean"
864#line 348 "dhcp4_parser.yy"
865 { yylhs.value.as < ElementPtr > () = ElementPtr(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location))); }
866#line 867 "dhcp4_parser.cc"
867 break;
868
869 case 31: // value: "constant string"
870#line 349 "dhcp4_parser.yy"
871 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); }
872#line 873 "dhcp4_parser.cc"
873 break;
874
875 case 32: // value: "null"
876#line 350 "dhcp4_parser.yy"
877 { yylhs.value.as < ElementPtr > () = ElementPtr(new NullElement(ctx.loc2pos(yystack_[0].location))); }
878#line 879 "dhcp4_parser.cc"
879 break;
880
881 case 33: // value: map2
882#line 351 "dhcp4_parser.yy"
883 { yylhs.value.as < ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
884#line 885 "dhcp4_parser.cc"
885 break;
886
887 case 34: // value: list_generic
888#line 352 "dhcp4_parser.yy"
889 { yylhs.value.as < ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
890#line 891 "dhcp4_parser.cc"
891 break;
892
893 case 35: // sub_json: value
894#line 355 "dhcp4_parser.yy"
895 {
896 // Push back the JSON value on the stack
897 ctx.stack_.push_back(yystack_[0].value.as < ElementPtr > ());
898}
899#line 900 "dhcp4_parser.cc"
900 break;
901
902 case 36: // $@14: %empty
903#line 360 "dhcp4_parser.yy"
904 {
905 // This code is executed when we're about to start parsing
906 // the content of the map
907 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
908 ctx.stack_.push_back(m);
909}
910#line 911 "dhcp4_parser.cc"
911 break;
912
913 case 37: // map2: "{" $@14 map_content "}"
914#line 365 "dhcp4_parser.yy"
915 {
916 // map parsing completed. If we ever want to do any wrap up
917 // (maybe some sanity checking), this would be the best place
918 // for it.
919}
920#line 921 "dhcp4_parser.cc"
921 break;
922
923 case 38: // map_value: map2
924#line 371 "dhcp4_parser.yy"
925 { yylhs.value.as < ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
926#line 927 "dhcp4_parser.cc"
927 break;
928
929 case 41: // not_empty_map: "constant string" ":" value
930#line 378 "dhcp4_parser.yy"
931 {
932 // map containing a single entry
933 ctx.unique(yystack_[2].value.as < std::string > (), ctx.loc2pos(yystack_[2].location));
934 ctx.stack_.back()->set(yystack_[2].value.as < std::string > (), yystack_[0].value.as < ElementPtr > ());
935 }
936#line 937 "dhcp4_parser.cc"
937 break;
938
939 case 42: // not_empty_map: not_empty_map "," "constant string" ":" value
940#line 383 "dhcp4_parser.yy"
941 {
942 // map consisting of a shorter map followed by
943 // comma and string:value
944 ctx.unique(yystack_[2].value.as < std::string > (), ctx.loc2pos(yystack_[2].location));
945 ctx.stack_.back()->set(yystack_[2].value.as < std::string > (), yystack_[0].value.as < ElementPtr > ());
946 }
947#line 948 "dhcp4_parser.cc"
948 break;
949
950 case 43: // not_empty_map: not_empty_map ","
951#line 389 "dhcp4_parser.yy"
952 {
953 ctx.warnAboutExtraCommas(yystack_[0].location);
954 }
955#line 956 "dhcp4_parser.cc"
956 break;
957
958 case 44: // $@15: %empty
959#line 394 "dhcp4_parser.yy"
960 {
961 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
962 ctx.stack_.push_back(l);
963}
964#line 965 "dhcp4_parser.cc"
965 break;
966
967 case 45: // list_generic: "[" $@15 list_content "]"
968#line 397 "dhcp4_parser.yy"
969 {
970 // list parsing complete. Put any sanity checking here
971}
972#line 973 "dhcp4_parser.cc"
973 break;
974
975 case 48: // not_empty_list: value
976#line 405 "dhcp4_parser.yy"
977 {
978 // List consisting of a single element.
979 ctx.stack_.back()->add(yystack_[0].value.as < ElementPtr > ());
980 }
981#line 982 "dhcp4_parser.cc"
982 break;
983
984 case 49: // not_empty_list: not_empty_list "," value
985#line 409 "dhcp4_parser.yy"
986 {
987 // List ending with , and a value.
988 ctx.stack_.back()->add(yystack_[0].value.as < ElementPtr > ());
989 }
990#line 991 "dhcp4_parser.cc"
991 break;
992
993 case 50: // not_empty_list: not_empty_list ","
994#line 413 "dhcp4_parser.yy"
995 {
996 ctx.warnAboutExtraCommas(yystack_[0].location);
997 }
998#line 999 "dhcp4_parser.cc"
999 break;
1000
1001 case 51: // $@16: %empty
1002#line 419 "dhcp4_parser.yy"
1003 {
1004 // List parsing about to start
1005}
1006#line 1007 "dhcp4_parser.cc"
1007 break;
1008
1009 case 52: // list_strings: "[" $@16 list_strings_content "]"
1010#line 421 "dhcp4_parser.yy"
1011 {
1012 // list parsing complete. Put any sanity checking here
1013 //ctx.stack_.pop_back();
1014}
1015#line 1016 "dhcp4_parser.cc"
1016 break;
1017
1018 case 55: // not_empty_list_strings: "constant string"
1019#line 430 "dhcp4_parser.yy"
1020 {
1021 ElementPtr s(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1022 ctx.stack_.back()->add(s);
1023 }
1024#line 1025 "dhcp4_parser.cc"
1025 break;
1026
1027 case 56: // not_empty_list_strings: not_empty_list_strings "," "constant string"
1028#line 434 "dhcp4_parser.yy"
1029 {
1030 ElementPtr s(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1031 ctx.stack_.back()->add(s);
1032 }
1033#line 1034 "dhcp4_parser.cc"
1034 break;
1035
1036 case 57: // not_empty_list_strings: not_empty_list_strings ","
1037#line 438 "dhcp4_parser.yy"
1038 {
1039 ctx.warnAboutExtraCommas(yystack_[0].location);
1040 }
1041#line 1042 "dhcp4_parser.cc"
1042 break;
1043
1044 case 58: // unknown_map_entry: "constant string" ":"
1045#line 448 "dhcp4_parser.yy"
1046 {
1047 const std::string& where = ctx.contextName();
1048 const std::string& keyword = yystack_[1].value.as < std::string > ();
1049 error(yystack_[1].location,
1050 "got unexpected keyword \"" + keyword + "\" in " + where + " map.");
1051}
1052#line 1053 "dhcp4_parser.cc"
1053 break;
1054
1055 case 59: // $@17: %empty
1056#line 457 "dhcp4_parser.yy"
1057 {
1058 // This code is executed when we're about to start parsing
1059 // the content of the map
1060 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1061 ctx.stack_.push_back(m);
1062}
1063#line 1064 "dhcp4_parser.cc"
1064 break;
1065
1066 case 60: // syntax_map: "{" $@17 global_object "}"
1067#line 462 "dhcp4_parser.yy"
1068 {
1069 // map parsing completed. If we ever want to do any wrap up
1070 // (maybe some sanity checking), this would be the best place
1071 // for it.
1072
1073 // Dhcp4 is required
1074 ctx.require("Dhcp4", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
1075}
1076#line 1077 "dhcp4_parser.cc"
1077 break;
1078
1079 case 61: // $@18: %empty
1080#line 472 "dhcp4_parser.yy"
1081 {
1082 // This code is executed when we're about to start parsing
1083 // the content of the map
1084 // Prevent against duplicate.
1085 ctx.unique("Dhcp4", ctx.loc2pos(yystack_[0].location));
1086 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1087 ctx.stack_.back()->set("Dhcp4", m);
1088 ctx.stack_.push_back(m);
1089 ctx.enter(ctx.DHCP4);
1090}
1091#line 1092 "dhcp4_parser.cc"
1092 break;
1093
1094 case 62: // global_object: "Dhcp4" $@18 ":" "{" global_params "}"
1095#line 481 "dhcp4_parser.yy"
1096 {
1097 // No global parameter is required
1098 ctx.stack_.pop_back();
1099 ctx.leave();
1100}
1101#line 1102 "dhcp4_parser.cc"
1102 break;
1103
1104 case 64: // global_object_comma: global_object ","
1105#line 489 "dhcp4_parser.yy"
1106 {
1107 ctx.warnAboutExtraCommas(yystack_[0].location);
1108}
1109#line 1110 "dhcp4_parser.cc"
1110 break;
1111
1112 case 65: // $@19: %empty
1113#line 495 "dhcp4_parser.yy"
1114 {
1115 // Parse the Dhcp4 map
1116 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1117 ctx.stack_.push_back(m);
1118}
1119#line 1120 "dhcp4_parser.cc"
1120 break;
1121
1122 case 66: // sub_dhcp4: "{" $@19 global_params "}"
1123#line 499 "dhcp4_parser.yy"
1124 {
1125 // No global parameter is required
1126 // parsing completed
1127}
1128#line 1129 "dhcp4_parser.cc"
1129 break;
1130
1131 case 69: // global_params: global_params ","
1132#line 506 "dhcp4_parser.yy"
1133 {
1134 ctx.warnAboutExtraCommas(yystack_[0].location);
1135 }
1136#line 1137 "dhcp4_parser.cc"
1137 break;
1138
1139 case 139: // valid_lifetime: "valid-lifetime" ":" "integer"
1140#line 584 "dhcp4_parser.yy"
1141 {
1142 ctx.unique("valid-lifetime", ctx.loc2pos(yystack_[2].location));
1143 ElementPtr prf(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1144 ctx.stack_.back()->set("valid-lifetime", prf);
1145}
1146#line 1147 "dhcp4_parser.cc"
1147 break;
1148
1149 case 140: // min_valid_lifetime: "min-valid-lifetime" ":" "integer"
1150#line 590 "dhcp4_parser.yy"
1151 {
1152 ctx.unique("min-valid-lifetime", ctx.loc2pos(yystack_[2].location));
1153 ElementPtr prf(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1154 ctx.stack_.back()->set("min-valid-lifetime", prf);
1155}
1156#line 1157 "dhcp4_parser.cc"
1157 break;
1158
1159 case 141: // max_valid_lifetime: "max-valid-lifetime" ":" "integer"
1160#line 596 "dhcp4_parser.yy"
1161 {
1162 ctx.unique("max-valid-lifetime", ctx.loc2pos(yystack_[2].location));
1163 ElementPtr prf(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1164 ctx.stack_.back()->set("max-valid-lifetime", prf);
1165}
1166#line 1167 "dhcp4_parser.cc"
1167 break;
1168
1169 case 142: // renew_timer: "renew-timer" ":" "integer"
1170#line 602 "dhcp4_parser.yy"
1171 {
1172 ctx.unique("renew-timer", ctx.loc2pos(yystack_[2].location));
1173 ElementPtr prf(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1174 ctx.stack_.back()->set("renew-timer", prf);
1175}
1176#line 1177 "dhcp4_parser.cc"
1177 break;
1178
1179 case 143: // rebind_timer: "rebind-timer" ":" "integer"
1180#line 608 "dhcp4_parser.yy"
1181 {
1182 ctx.unique("rebind-timer", ctx.loc2pos(yystack_[2].location));
1183 ElementPtr prf(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1184 ctx.stack_.back()->set("rebind-timer", prf);
1185}
1186#line 1187 "dhcp4_parser.cc"
1187 break;
1188
1189 case 144: // calculate_tee_times: "calculate-tee-times" ":" "boolean"
1190#line 614 "dhcp4_parser.yy"
1191 {
1192 ctx.unique("calculate-tee-times", ctx.loc2pos(yystack_[2].location));
1193 ElementPtr ctt(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1194 ctx.stack_.back()->set("calculate-tee-times", ctt);
1195}
1196#line 1197 "dhcp4_parser.cc"
1197 break;
1198
1199 case 145: // t1_percent: "t1-percent" ":" "floating point"
1200#line 620 "dhcp4_parser.yy"
1201 {
1202 ctx.unique("t1-percent", ctx.loc2pos(yystack_[2].location));
1203 ElementPtr t1(new DoubleElement(yystack_[0].value.as < double > (), ctx.loc2pos(yystack_[0].location)));
1204 ctx.stack_.back()->set("t1-percent", t1);
1205}
1206#line 1207 "dhcp4_parser.cc"
1207 break;
1208
1209 case 146: // t2_percent: "t2-percent" ":" "floating point"
1210#line 626 "dhcp4_parser.yy"
1211 {
1212 ctx.unique("t2-percent", ctx.loc2pos(yystack_[2].location));
1213 ElementPtr t2(new DoubleElement(yystack_[0].value.as < double > (), ctx.loc2pos(yystack_[0].location)));
1214 ctx.stack_.back()->set("t2-percent", t2);
1215}
1216#line 1217 "dhcp4_parser.cc"
1217 break;
1218
1219 case 147: // cache_threshold: "cache-threshold" ":" "floating point"
1220#line 632 "dhcp4_parser.yy"
1221 {
1222 ctx.unique("cache-threshold", ctx.loc2pos(yystack_[2].location));
1223 ElementPtr ct(new DoubleElement(yystack_[0].value.as < double > (), ctx.loc2pos(yystack_[0].location)));
1224 ctx.stack_.back()->set("cache-threshold", ct);
1225}
1226#line 1227 "dhcp4_parser.cc"
1227 break;
1228
1229 case 148: // cache_max_age: "cache-max-age" ":" "integer"
1230#line 638 "dhcp4_parser.yy"
1231 {
1232 ctx.unique("cache-max-age", ctx.loc2pos(yystack_[2].location));
1233 ElementPtr cm(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1234 ctx.stack_.back()->set("cache-max-age", cm);
1235}
1236#line 1237 "dhcp4_parser.cc"
1237 break;
1238
1239 case 149: // decline_probation_period: "decline-probation-period" ":" "integer"
1240#line 644 "dhcp4_parser.yy"
1241 {
1242 ctx.unique("decline-probation-period", ctx.loc2pos(yystack_[2].location));
1243 ElementPtr dpp(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1244 ctx.stack_.back()->set("decline-probation-period", dpp);
1245}
1246#line 1247 "dhcp4_parser.cc"
1247 break;
1248
1249 case 150: // $@20: %empty
1250#line 650 "dhcp4_parser.yy"
1251 {
1252 ctx.unique("server-tag", ctx.loc2pos(yystack_[0].location));
1253 ctx.enter(ctx.NO_KEYWORD);
1254}
1255#line 1256 "dhcp4_parser.cc"
1256 break;
1257
1258 case 151: // server_tag: "server-tag" $@20 ":" "constant string"
1259#line 653 "dhcp4_parser.yy"
1260 {
1261 ElementPtr stag(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1262 ctx.stack_.back()->set("server-tag", stag);
1263 ctx.leave();
1264}
1265#line 1266 "dhcp4_parser.cc"
1266 break;
1267
1268 case 152: // parked_packet_limit: "parked-packet-limit" ":" "integer"
1269#line 659 "dhcp4_parser.yy"
1270 {
1271 ctx.unique("parked-packet-limit", ctx.loc2pos(yystack_[2].location));
1272 ElementPtr ppl(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1273 ctx.stack_.back()->set("parked-packet-limit", ppl);
1274}
1275#line 1276 "dhcp4_parser.cc"
1276 break;
1277
1278 case 153: // $@21: %empty
1279#line 665 "dhcp4_parser.yy"
1280 {
1281 ctx.unique("allocator", ctx.loc2pos(yystack_[0].location));
1282 ctx.enter(ctx.NO_KEYWORD);
1283}
1284#line 1285 "dhcp4_parser.cc"
1285 break;
1286
1287 case 154: // allocator: "allocator" $@21 ":" "constant string"
1288#line 668 "dhcp4_parser.yy"
1289 {
1290 ElementPtr al(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1291 ctx.stack_.back()->set("allocator", al);
1292 ctx.leave();
1293}
1294#line 1295 "dhcp4_parser.cc"
1295 break;
1296
1297 case 155: // echo_client_id: "echo-client-id" ":" "boolean"
1298#line 674 "dhcp4_parser.yy"
1299 {
1300 ctx.unique("echo-client-id", ctx.loc2pos(yystack_[2].location));
1301 ElementPtr echo(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1302 ctx.stack_.back()->set("echo-client-id", echo);
1303}
1304#line 1305 "dhcp4_parser.cc"
1305 break;
1306
1307 case 156: // match_client_id: "match-client-id" ":" "boolean"
1308#line 680 "dhcp4_parser.yy"
1309 {
1310 ctx.unique("match-client-id", ctx.loc2pos(yystack_[2].location));
1311 ElementPtr match(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1312 ctx.stack_.back()->set("match-client-id", match);
1313}
1314#line 1315 "dhcp4_parser.cc"
1315 break;
1316
1317 case 157: // authoritative: "authoritative" ":" "boolean"
1318#line 686 "dhcp4_parser.yy"
1319 {
1320 ctx.unique("authoritative", ctx.loc2pos(yystack_[2].location));
1321 ElementPtr prf(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1322 ctx.stack_.back()->set("authoritative", prf);
1323}
1324#line 1325 "dhcp4_parser.cc"
1325 break;
1326
1327 case 158: // ddns_send_updates: "ddns-send-updates" ":" "boolean"
1328#line 692 "dhcp4_parser.yy"
1329 {
1330 ctx.unique("ddns-send-updates", ctx.loc2pos(yystack_[2].location));
1331 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1332 ctx.stack_.back()->set("ddns-send-updates", b);
1333}
1334#line 1335 "dhcp4_parser.cc"
1335 break;
1336
1337 case 159: // ddns_override_no_update: "ddns-override-no-update" ":" "boolean"
1338#line 698 "dhcp4_parser.yy"
1339 {
1340 ctx.unique("ddns-override-no-update", ctx.loc2pos(yystack_[2].location));
1341 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1342 ctx.stack_.back()->set("ddns-override-no-update", b);
1343}
1344#line 1345 "dhcp4_parser.cc"
1345 break;
1346
1347 case 160: // ddns_override_client_update: "ddns-override-client-update" ":" "boolean"
1348#line 704 "dhcp4_parser.yy"
1349 {
1350 ctx.unique("ddns-override-client-update", ctx.loc2pos(yystack_[2].location));
1351 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1352 ctx.stack_.back()->set("ddns-override-client-update", b);
1353}
1354#line 1355 "dhcp4_parser.cc"
1355 break;
1356
1357 case 161: // $@22: %empty
1358#line 710 "dhcp4_parser.yy"
1359 {
1360 ctx.enter(ctx.REPLACE_CLIENT_NAME);
1361 ctx.unique("ddns-replace-client-name", ctx.loc2pos(yystack_[0].location));
1362}
1363#line 1364 "dhcp4_parser.cc"
1364 break;
1365
1366 case 162: // ddns_replace_client_name: "ddns-replace-client-name" $@22 ":" ddns_replace_client_name_value
1367#line 713 "dhcp4_parser.yy"
1368 {
1369 ctx.stack_.back()->set("ddns-replace-client-name", yystack_[0].value.as < ElementPtr > ());
1370 ctx.leave();
1371}
1372#line 1373 "dhcp4_parser.cc"
1373 break;
1374
1375 case 163: // ddns_replace_client_name_value: "when-present"
1376#line 719 "dhcp4_parser.yy"
1377 {
1378 yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("when-present", ctx.loc2pos(yystack_[0].location)));
1379 }
1380#line 1381 "dhcp4_parser.cc"
1381 break;
1382
1383 case 164: // ddns_replace_client_name_value: "never"
1384#line 722 "dhcp4_parser.yy"
1385 {
1386 yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("never", ctx.loc2pos(yystack_[0].location)));
1387 }
1388#line 1389 "dhcp4_parser.cc"
1389 break;
1390
1391 case 165: // ddns_replace_client_name_value: "always"
1392#line 725 "dhcp4_parser.yy"
1393 {
1394 yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("always", ctx.loc2pos(yystack_[0].location)));
1395 }
1396#line 1397 "dhcp4_parser.cc"
1397 break;
1398
1399 case 166: // ddns_replace_client_name_value: "when-not-present"
1400#line 728 "dhcp4_parser.yy"
1401 {
1402 yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("when-not-present", ctx.loc2pos(yystack_[0].location)));
1403 }
1404#line 1405 "dhcp4_parser.cc"
1405 break;
1406
1407 case 167: // ddns_replace_client_name_value: "boolean"
1408#line 731 "dhcp4_parser.yy"
1409 {
1410 error(yystack_[0].location, "boolean values for the ddns-replace-client-name are "
1411 "no longer supported");
1412 }
1413#line 1414 "dhcp4_parser.cc"
1414 break;
1415
1416 case 168: // $@23: %empty
1417#line 737 "dhcp4_parser.yy"
1418 {
1419 ctx.unique("ddns-generated-prefix", ctx.loc2pos(yystack_[0].location));
1420 ctx.enter(ctx.NO_KEYWORD);
1421}
1422#line 1423 "dhcp4_parser.cc"
1423 break;
1424
1425 case 169: // ddns_generated_prefix: "ddns-generated-prefix" $@23 ":" "constant string"
1426#line 740 "dhcp4_parser.yy"
1427 {
1428 ElementPtr s(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1429 ctx.stack_.back()->set("ddns-generated-prefix", s);
1430 ctx.leave();
1431}
1432#line 1433 "dhcp4_parser.cc"
1433 break;
1434
1435 case 170: // $@24: %empty
1436#line 746 "dhcp4_parser.yy"
1437 {
1438 ctx.unique("ddns-qualifying-suffix", ctx.loc2pos(yystack_[0].location));
1439 ctx.enter(ctx.NO_KEYWORD);
1440}
1441#line 1442 "dhcp4_parser.cc"
1442 break;
1443
1444 case 171: // ddns_qualifying_suffix: "ddns-qualifying-suffix" $@24 ":" "constant string"
1445#line 749 "dhcp4_parser.yy"
1446 {
1447 ElementPtr s(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1448 ctx.stack_.back()->set("ddns-qualifying-suffix", s);
1449 ctx.leave();
1450}
1451#line 1452 "dhcp4_parser.cc"
1452 break;
1453
1454 case 172: // ddns_update_on_renew: "ddns-update-on-renew" ":" "boolean"
1455#line 755 "dhcp4_parser.yy"
1456 {
1457 ctx.unique("ddns-update-on-renew", ctx.loc2pos(yystack_[2].location));
1458 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1459 ctx.stack_.back()->set("ddns-update-on-renew", b);
1460}
1461#line 1462 "dhcp4_parser.cc"
1462 break;
1463
1464 case 173: // ddns_use_conflict_resolution: "ddns-use-conflict-resolution" ":" "boolean"
1465#line 764 "dhcp4_parser.yy"
1466 {
1467 ctx.unique("ddns-use-conflict-resolution", ctx.loc2pos(yystack_[2].location));
1468 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1469 ctx.warning(yystack_[1].location, "ddns-use-conflict-resolution is deprecated. "
1470 "Substituting ddns-conflict-resolution-mode");
1471 ElementPtr mode(new StringElement(b->boolValue() ? "check-with-dhcid"
1472 : "no-check-with-dhcid"));
1473 ctx.stack_.back()->set("ddns-conflict-resolution-mode", mode);
1474}
1475#line 1476 "dhcp4_parser.cc"
1476 break;
1477
1478 case 174: // $@25: %empty
1479#line 774 "dhcp4_parser.yy"
1480 {
1481 ctx.unique("ddns-conflict-resolution-mode", ctx.loc2pos(yystack_[0].location));
1483}
1484#line 1485 "dhcp4_parser.cc"
1485 break;
1486
1487 case 175: // ddns_conflict_resolution_mode: "ddns-conflict-resolution-mode" $@25 ":" ddns_conflict_resolution_mode_value
1488#line 777 "dhcp4_parser.yy"
1489 {
1490 ctx.stack_.back()->set("ddns-conflict-resolution-mode", yystack_[0].value.as < ElementPtr > ());
1491 ctx.leave();
1492}
1493#line 1494 "dhcp4_parser.cc"
1494 break;
1495
1496 case 176: // ddns_conflict_resolution_mode_value: "check-with-dhcid"
1497#line 783 "dhcp4_parser.yy"
1498 {
1499 yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("check-with-dhcid", ctx.loc2pos(yystack_[0].location)));
1500 }
1501#line 1502 "dhcp4_parser.cc"
1502 break;
1503
1504 case 177: // ddns_conflict_resolution_mode_value: "no-check-with-dhcid"
1505#line 786 "dhcp4_parser.yy"
1506 {
1507 yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("no-check-with-dhcid", ctx.loc2pos(yystack_[0].location)));
1508 }
1509#line 1510 "dhcp4_parser.cc"
1510 break;
1511
1512 case 178: // ddns_conflict_resolution_mode_value: "check-exists-with-dhcid"
1513#line 789 "dhcp4_parser.yy"
1514 {
1515 yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("check-exists-with-dhcid", ctx.loc2pos(yystack_[0].location)));
1516 }
1517#line 1518 "dhcp4_parser.cc"
1518 break;
1519
1520 case 179: // ddns_conflict_resolution_mode_value: "no-check-without-dhcid"
1521#line 792 "dhcp4_parser.yy"
1522 {
1523 yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("no-check-without-dhcid", ctx.loc2pos(yystack_[0].location)));
1524 }
1525#line 1526 "dhcp4_parser.cc"
1526 break;
1527
1528 case 180: // ddns_ttl_percent: "ddns-ttl-percent" ":" "floating point"
1529#line 797 "dhcp4_parser.yy"
1530 {
1531 ctx.unique("ddns-ttl-percent", ctx.loc2pos(yystack_[2].location));
1532 ElementPtr ttl(new DoubleElement(yystack_[0].value.as < double > (), ctx.loc2pos(yystack_[0].location)));
1533 ctx.stack_.back()->set("ddns-ttl-percent", ttl);
1534}
1535#line 1536 "dhcp4_parser.cc"
1536 break;
1537
1538 case 181: // $@26: %empty
1539#line 803 "dhcp4_parser.yy"
1540 {
1541 ctx.unique("hostname-char-set", ctx.loc2pos(yystack_[0].location));
1542 ctx.enter(ctx.NO_KEYWORD);
1543}
1544#line 1545 "dhcp4_parser.cc"
1545 break;
1546
1547 case 182: // hostname_char_set: "hostname-char-set" $@26 ":" "constant string"
1548#line 806 "dhcp4_parser.yy"
1549 {
1550 ElementPtr s(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1551 ctx.stack_.back()->set("hostname-char-set", s);
1552 ctx.leave();
1553}
1554#line 1555 "dhcp4_parser.cc"
1555 break;
1556
1557 case 183: // $@27: %empty
1558#line 812 "dhcp4_parser.yy"
1559 {
1560 ctx.unique("hostname-char-replacement", ctx.loc2pos(yystack_[0].location));
1561 ctx.enter(ctx.NO_KEYWORD);
1562}
1563#line 1564 "dhcp4_parser.cc"
1564 break;
1565
1566 case 184: // hostname_char_replacement: "hostname-char-replacement" $@27 ":" "constant string"
1567#line 815 "dhcp4_parser.yy"
1568 {
1569 ElementPtr s(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1570 ctx.stack_.back()->set("hostname-char-replacement", s);
1571 ctx.leave();
1572}
1573#line 1574 "dhcp4_parser.cc"
1574 break;
1575
1576 case 185: // store_extended_info: "store-extended-info" ":" "boolean"
1577#line 821 "dhcp4_parser.yy"
1578 {
1579 ctx.unique("store-extended-info", ctx.loc2pos(yystack_[2].location));
1580 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1581 ctx.stack_.back()->set("store-extended-info", b);
1582}
1583#line 1584 "dhcp4_parser.cc"
1584 break;
1585
1586 case 186: // statistic_default_sample_count: "statistic-default-sample-count" ":" "integer"
1587#line 827 "dhcp4_parser.yy"
1588 {
1589 ctx.unique("statistic-default-sample-count", ctx.loc2pos(yystack_[2].location));
1590 ElementPtr count(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1591 ctx.stack_.back()->set("statistic-default-sample-count", count);
1592}
1593#line 1594 "dhcp4_parser.cc"
1594 break;
1595
1596 case 187: // statistic_default_sample_age: "statistic-default-sample-age" ":" "integer"
1597#line 833 "dhcp4_parser.yy"
1598 {
1599 ctx.unique("statistic-default-sample-age", ctx.loc2pos(yystack_[2].location));
1600 ElementPtr age(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1601 ctx.stack_.back()->set("statistic-default-sample-age", age);
1602}
1603#line 1604 "dhcp4_parser.cc"
1604 break;
1605
1606 case 188: // early_global_reservations_lookup: "early-global-reservations-lookup" ":" "boolean"
1607#line 839 "dhcp4_parser.yy"
1608 {
1609 ctx.unique("early-global-reservations-lookup", ctx.loc2pos(yystack_[2].location));
1610 ElementPtr early(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1611 ctx.stack_.back()->set("early-global-reservations-lookup", early);
1612}
1613#line 1614 "dhcp4_parser.cc"
1614 break;
1615
1616 case 189: // ip_reservations_unique: "ip-reservations-unique" ":" "boolean"
1617#line 845 "dhcp4_parser.yy"
1618 {
1619 ctx.unique("ip-reservations-unique", ctx.loc2pos(yystack_[2].location));
1620 ElementPtr unique(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1621 ctx.stack_.back()->set("ip-reservations-unique", unique);
1622}
1623#line 1624 "dhcp4_parser.cc"
1624 break;
1625
1626 case 190: // reservations_lookup_first: "reservations-lookup-first" ":" "boolean"
1627#line 851 "dhcp4_parser.yy"
1628 {
1629 ctx.unique("reservations-lookup-first", ctx.loc2pos(yystack_[2].location));
1630 ElementPtr first(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1631 ctx.stack_.back()->set("reservations-lookup-first", first);
1632}
1633#line 1634 "dhcp4_parser.cc"
1634 break;
1635
1636 case 191: // offer_lifetime: "offer-lifetime" ":" "integer"
1637#line 857 "dhcp4_parser.yy"
1638 {
1639 ctx.unique("offer-lifetime", ctx.loc2pos(yystack_[2].location));
1640 ElementPtr offer_lifetime(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1641 ctx.stack_.back()->set("offer-lifetime", offer_lifetime);
1642}
1643#line 1644 "dhcp4_parser.cc"
1644 break;
1645
1646 case 192: // stash_agent_options: "stash-agent-options" ":" "boolean"
1647#line 863 "dhcp4_parser.yy"
1648 {
1649 ctx.unique("stash-agent-options", ctx.loc2pos(yystack_[2].location));
1650 ElementPtr stash(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1651 ctx.stack_.back()->set("stash-agent-options", stash);
1652}
1653#line 1654 "dhcp4_parser.cc"
1654 break;
1655
1656 case 193: // $@28: %empty
1657#line 869 "dhcp4_parser.yy"
1658 {
1659 ctx.unique("interfaces-config", ctx.loc2pos(yystack_[0].location));
1660 ElementPtr i(new MapElement(ctx.loc2pos(yystack_[0].location)));
1661 ctx.stack_.back()->set("interfaces-config", i);
1662 ctx.stack_.push_back(i);
1663 ctx.enter(ctx.INTERFACES_CONFIG);
1664}
1665#line 1666 "dhcp4_parser.cc"
1666 break;
1667
1668 case 194: // interfaces_config: "interfaces-config" $@28 ":" "{" interfaces_config_params "}"
1669#line 875 "dhcp4_parser.yy"
1670 {
1671 // No interfaces config param is required
1672 ctx.stack_.pop_back();
1673 ctx.leave();
1674}
1675#line 1676 "dhcp4_parser.cc"
1676 break;
1677
1678 case 197: // interfaces_config_params: interfaces_config_params ","
1679#line 883 "dhcp4_parser.yy"
1680 {
1681 ctx.warnAboutExtraCommas(yystack_[0].location);
1682 }
1683#line 1684 "dhcp4_parser.cc"
1684 break;
1685
1686 case 208: // $@29: %empty
1687#line 900 "dhcp4_parser.yy"
1688 {
1689 // Parse the interfaces-config map
1690 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1691 ctx.stack_.push_back(m);
1692}
1693#line 1694 "dhcp4_parser.cc"
1694 break;
1695
1696 case 209: // sub_interfaces4: "{" $@29 interfaces_config_params "}"
1697#line 904 "dhcp4_parser.yy"
1698 {
1699 // No interfaces config param is required
1700 // parsing completed
1701}
1702#line 1703 "dhcp4_parser.cc"
1703 break;
1704
1705 case 210: // $@30: %empty
1706#line 909 "dhcp4_parser.yy"
1707 {
1708 ctx.unique("interfaces", ctx.loc2pos(yystack_[0].location));
1709 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1710 ctx.stack_.back()->set("interfaces", l);
1711 ctx.stack_.push_back(l);
1712 ctx.enter(ctx.NO_KEYWORD);
1713}
1714#line 1715 "dhcp4_parser.cc"
1715 break;
1716
1717 case 211: // interfaces_list: "interfaces" $@30 ":" list_strings
1718#line 915 "dhcp4_parser.yy"
1719 {
1720 ctx.stack_.pop_back();
1721 ctx.leave();
1722}
1723#line 1724 "dhcp4_parser.cc"
1724 break;
1725
1726 case 212: // $@31: %empty
1727#line 920 "dhcp4_parser.yy"
1728 {
1729 ctx.unique("dhcp-socket-type", ctx.loc2pos(yystack_[0].location));
1730 ctx.enter(ctx.DHCP_SOCKET_TYPE);
1731}
1732#line 1733 "dhcp4_parser.cc"
1733 break;
1734
1735 case 213: // dhcp_socket_type: "dhcp-socket-type" $@31 ":" socket_type
1736#line 923 "dhcp4_parser.yy"
1737 {
1738 ctx.stack_.back()->set("dhcp-socket-type", yystack_[0].value.as < ElementPtr > ());
1739 ctx.leave();
1740}
1741#line 1742 "dhcp4_parser.cc"
1742 break;
1743
1744 case 214: // socket_type: "raw"
1745#line 928 "dhcp4_parser.yy"
1746 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("raw", ctx.loc2pos(yystack_[0].location))); }
1747#line 1748 "dhcp4_parser.cc"
1748 break;
1749
1750 case 215: // socket_type: "udp"
1751#line 929 "dhcp4_parser.yy"
1752 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("udp", ctx.loc2pos(yystack_[0].location))); }
1753#line 1754 "dhcp4_parser.cc"
1754 break;
1755
1756 case 216: // $@32: %empty
1757#line 932 "dhcp4_parser.yy"
1758 {
1759 ctx.unique("outbound-interface", ctx.loc2pos(yystack_[0].location));
1760 ctx.enter(ctx.OUTBOUND_INTERFACE);
1761}
1762#line 1763 "dhcp4_parser.cc"
1763 break;
1764
1765 case 217: // outbound_interface: "outbound-interface" $@32 ":" outbound_interface_value
1766#line 935 "dhcp4_parser.yy"
1767 {
1768 ctx.stack_.back()->set("outbound-interface", yystack_[0].value.as < ElementPtr > ());
1769 ctx.leave();
1770}
1771#line 1772 "dhcp4_parser.cc"
1772 break;
1773
1774 case 218: // outbound_interface_value: "same-as-inbound"
1775#line 940 "dhcp4_parser.yy"
1776 {
1777 yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("same-as-inbound", ctx.loc2pos(yystack_[0].location)));
1778}
1779#line 1780 "dhcp4_parser.cc"
1780 break;
1781
1782 case 219: // outbound_interface_value: "use-routing"
1783#line 942 "dhcp4_parser.yy"
1784 {
1785 yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("use-routing", ctx.loc2pos(yystack_[0].location)));
1786 }
1787#line 1788 "dhcp4_parser.cc"
1788 break;
1789
1790 case 220: // re_detect: "re-detect" ":" "boolean"
1791#line 946 "dhcp4_parser.yy"
1792 {
1793 ctx.unique("re-detect", ctx.loc2pos(yystack_[2].location));
1794 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1795 ctx.stack_.back()->set("re-detect", b);
1796}
1797#line 1798 "dhcp4_parser.cc"
1798 break;
1799
1800 case 221: // service_sockets_require_all: "service-sockets-require-all" ":" "boolean"
1801#line 952 "dhcp4_parser.yy"
1802 {
1803 ctx.unique("service-sockets-require-all", ctx.loc2pos(yystack_[2].location));
1804 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
1805 ctx.stack_.back()->set("service-sockets-require-all", b);
1806}
1807#line 1808 "dhcp4_parser.cc"
1808 break;
1809
1810 case 222: // service_sockets_retry_wait_time: "service-sockets-retry-wait-time" ":" "integer"
1811#line 958 "dhcp4_parser.yy"
1812 {
1813 ctx.unique("service-sockets-retry-wait-time", ctx.loc2pos(yystack_[2].location));
1814 ElementPtr n(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1815 ctx.stack_.back()->set("service-sockets-retry-wait-time", n);
1816}
1817#line 1818 "dhcp4_parser.cc"
1818 break;
1819
1820 case 223: // service_sockets_max_retries: "service-sockets-max-retries" ":" "integer"
1821#line 964 "dhcp4_parser.yy"
1822 {
1823 ctx.unique("service-sockets-max-retries", ctx.loc2pos(yystack_[2].location));
1824 ElementPtr n(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
1825 ctx.stack_.back()->set("service-sockets-max-retries", n);
1826}
1827#line 1828 "dhcp4_parser.cc"
1828 break;
1829
1830 case 224: // $@33: %empty
1831#line 970 "dhcp4_parser.yy"
1832 {
1833 ctx.unique("lease-database", ctx.loc2pos(yystack_[0].location));
1834 ElementPtr i(new MapElement(ctx.loc2pos(yystack_[0].location)));
1835 ctx.stack_.back()->set("lease-database", i);
1836 ctx.stack_.push_back(i);
1837 ctx.enter(ctx.LEASE_DATABASE);
1838}
1839#line 1840 "dhcp4_parser.cc"
1840 break;
1841
1842 case 225: // lease_database: "lease-database" $@33 ":" "{" database_map_params "}"
1843#line 976 "dhcp4_parser.yy"
1844 {
1845 // The type parameter is required
1846 ctx.require("type", ctx.loc2pos(yystack_[2].location), ctx.loc2pos(yystack_[0].location));
1847 ctx.stack_.pop_back();
1848 ctx.leave();
1849}
1850#line 1851 "dhcp4_parser.cc"
1851 break;
1852
1853 case 226: // $@34: %empty
1854#line 983 "dhcp4_parser.yy"
1855 {
1856 ctx.unique("sanity-checks", ctx.loc2pos(yystack_[0].location));
1857 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1858 ctx.stack_.back()->set("sanity-checks", m);
1859 ctx.stack_.push_back(m);
1860 ctx.enter(ctx.SANITY_CHECKS);
1861}
1862#line 1863 "dhcp4_parser.cc"
1863 break;
1864
1865 case 227: // sanity_checks: "sanity-checks" $@34 ":" "{" sanity_checks_params "}"
1866#line 989 "dhcp4_parser.yy"
1867 {
1868 ctx.stack_.pop_back();
1869 ctx.leave();
1870}
1871#line 1872 "dhcp4_parser.cc"
1872 break;
1873
1874 case 230: // sanity_checks_params: sanity_checks_params ","
1875#line 996 "dhcp4_parser.yy"
1876 {
1877 ctx.warnAboutExtraCommas(yystack_[0].location);
1878 }
1879#line 1880 "dhcp4_parser.cc"
1880 break;
1881
1882 case 233: // $@35: %empty
1883#line 1005 "dhcp4_parser.yy"
1884 {
1885 ctx.unique("lease-checks", ctx.loc2pos(yystack_[0].location));
1886 ctx.enter(ctx.NO_KEYWORD);
1887}
1888#line 1889 "dhcp4_parser.cc"
1889 break;
1890
1891 case 234: // lease_checks: "lease-checks" $@35 ":" "constant string"
1892#line 1008 "dhcp4_parser.yy"
1893 {
1894
1895 if ( (string(yystack_[0].value.as < std::string > ()) == "none") ||
1896 (string(yystack_[0].value.as < std::string > ()) == "warn") ||
1897 (string(yystack_[0].value.as < std::string > ()) == "fix") ||
1898 (string(yystack_[0].value.as < std::string > ()) == "fix-del") ||
1899 (string(yystack_[0].value.as < std::string > ()) == "del")) {
1900 ElementPtr user(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1901 ctx.stack_.back()->set("lease-checks", user);
1902 ctx.leave();
1903 } else {
1904 error(yystack_[0].location, "Unsupported 'lease-checks value: " + string(yystack_[0].value.as < std::string > ()) +
1905 ", supported values are: none, warn, fix, fix-del, del");
1906 }
1907}
1908#line 1909 "dhcp4_parser.cc"
1909 break;
1910
1911 case 235: // $@36: %empty
1912#line 1024 "dhcp4_parser.yy"
1913 {
1914 ctx.unique("extended-info-checks", ctx.loc2pos(yystack_[0].location));
1915 ctx.enter(ctx.NO_KEYWORD);
1916}
1917#line 1918 "dhcp4_parser.cc"
1918 break;
1919
1920 case 236: // extended_info_checks: "extended-info-checks" $@36 ":" "constant string"
1921#line 1027 "dhcp4_parser.yy"
1922 {
1923
1924 if ( (string(yystack_[0].value.as < std::string > ()) == "none") ||
1925 (string(yystack_[0].value.as < std::string > ()) == "fix") ||
1926 (string(yystack_[0].value.as < std::string > ()) == "strict") ||
1927 (string(yystack_[0].value.as < std::string > ()) == "pedantic")) {
1928 ElementPtr user(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
1929 ctx.stack_.back()->set("extended-info-checks", user);
1930 ctx.leave();
1931 } else {
1932 error(yystack_[0].location, "Unsupported 'extended-info-checks value: " + string(yystack_[0].value.as < std::string > ()) +
1933 ", supported values are: none, fix, strict, pedantic");
1934 }
1935}
1936#line 1937 "dhcp4_parser.cc"
1937 break;
1938
1939 case 237: // $@37: %empty
1940#line 1042 "dhcp4_parser.yy"
1941 {
1942 ctx.unique("hosts-database", ctx.loc2pos(yystack_[0].location));
1943 ElementPtr i(new MapElement(ctx.loc2pos(yystack_[0].location)));
1944 ctx.stack_.back()->set("hosts-database", i);
1945 ctx.stack_.push_back(i);
1946 ctx.enter(ctx.HOSTS_DATABASE);
1947}
1948#line 1949 "dhcp4_parser.cc"
1949 break;
1950
1951 case 238: // hosts_database: "hosts-database" $@37 ":" "{" database_map_params "}"
1952#line 1048 "dhcp4_parser.yy"
1953 {
1954 // The type parameter is required
1955 ctx.require("type", ctx.loc2pos(yystack_[2].location), ctx.loc2pos(yystack_[0].location));
1956 ctx.stack_.pop_back();
1957 ctx.leave();
1958}
1959#line 1960 "dhcp4_parser.cc"
1960 break;
1961
1962 case 239: // $@38: %empty
1963#line 1055 "dhcp4_parser.yy"
1964 {
1965 ctx.unique("hosts-databases", ctx.loc2pos(yystack_[0].location));
1966 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
1967 ctx.stack_.back()->set("hosts-databases", l);
1968 ctx.stack_.push_back(l);
1969 ctx.enter(ctx.HOSTS_DATABASE);
1970}
1971#line 1972 "dhcp4_parser.cc"
1972 break;
1973
1974 case 240: // hosts_databases: "hosts-databases" $@38 ":" "[" database_list "]"
1975#line 1061 "dhcp4_parser.yy"
1976 {
1977 ctx.stack_.pop_back();
1978 ctx.leave();
1979}
1980#line 1981 "dhcp4_parser.cc"
1981 break;
1982
1983 case 245: // not_empty_database_list: not_empty_database_list ","
1984#line 1072 "dhcp4_parser.yy"
1985 {
1986 ctx.warnAboutExtraCommas(yystack_[0].location);
1987 }
1988#line 1989 "dhcp4_parser.cc"
1989 break;
1990
1991 case 246: // $@39: %empty
1992#line 1077 "dhcp4_parser.yy"
1993 {
1994 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
1995 ctx.stack_.back()->add(m);
1996 ctx.stack_.push_back(m);
1997}
1998#line 1999 "dhcp4_parser.cc"
1999 break;
2000
2001 case 247: // database: "{" $@39 database_map_params "}"
2002#line 1081 "dhcp4_parser.yy"
2003 {
2004 // The type parameter is required
2005 ctx.require("type", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
2006 ctx.stack_.pop_back();
2007}
2008#line 2009 "dhcp4_parser.cc"
2009 break;
2010
2011 case 250: // database_map_params: database_map_params ","
2012#line 1089 "dhcp4_parser.yy"
2013 {
2014 ctx.warnAboutExtraCommas(yystack_[0].location);
2015 }
2016#line 2017 "dhcp4_parser.cc"
2017 break;
2018
2019 case 274: // $@40: %empty
2020#line 1119 "dhcp4_parser.yy"
2021 {
2022 ctx.unique("type", ctx.loc2pos(yystack_[0].location));
2023 ctx.enter(ctx.NO_KEYWORD);
2024}
2025#line 2026 "dhcp4_parser.cc"
2026 break;
2027
2028 case 275: // database_type: "type" $@40 ":" "constant string"
2029#line 1122 "dhcp4_parser.yy"
2030 {
2031 ElementPtr db_type(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2032 ctx.stack_.back()->set("type", db_type);
2033 ctx.leave();
2034}
2035#line 2036 "dhcp4_parser.cc"
2036 break;
2037
2038 case 276: // $@41: %empty
2039#line 1128 "dhcp4_parser.yy"
2040 {
2041 ctx.unique("user", ctx.loc2pos(yystack_[0].location));
2042 ctx.enter(ctx.NO_KEYWORD);
2043}
2044#line 2045 "dhcp4_parser.cc"
2045 break;
2046
2047 case 277: // user: "user" $@41 ":" "constant string"
2048#line 1131 "dhcp4_parser.yy"
2049 {
2050 ElementPtr user(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2051 ctx.stack_.back()->set("user", user);
2052 ctx.leave();
2053}
2054#line 2055 "dhcp4_parser.cc"
2055 break;
2056
2057 case 278: // $@42: %empty
2058#line 1137 "dhcp4_parser.yy"
2059 {
2060 ctx.unique("password", ctx.loc2pos(yystack_[0].location));
2061 ctx.enter(ctx.NO_KEYWORD);
2062}
2063#line 2064 "dhcp4_parser.cc"
2064 break;
2065
2066 case 279: // password: "password" $@42 ":" "constant string"
2067#line 1140 "dhcp4_parser.yy"
2068 {
2069 ElementPtr pwd(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2070 ctx.stack_.back()->set("password", pwd);
2071 ctx.leave();
2072}
2073#line 2074 "dhcp4_parser.cc"
2074 break;
2075
2076 case 280: // $@43: %empty
2077#line 1146 "dhcp4_parser.yy"
2078 {
2079 ctx.unique("host", ctx.loc2pos(yystack_[0].location));
2080 ctx.enter(ctx.NO_KEYWORD);
2081}
2082#line 2083 "dhcp4_parser.cc"
2083 break;
2084
2085 case 281: // host: "host" $@43 ":" "constant string"
2086#line 1149 "dhcp4_parser.yy"
2087 {
2088 ElementPtr h(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2089 ctx.stack_.back()->set("host", h);
2090 ctx.leave();
2091}
2092#line 2093 "dhcp4_parser.cc"
2093 break;
2094
2095 case 282: // port: "port" ":" "integer"
2096#line 1155 "dhcp4_parser.yy"
2097 {
2098 ctx.unique("port", ctx.loc2pos(yystack_[2].location));
2099 ElementPtr p(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2100 ctx.stack_.back()->set("port", p);
2101}
2102#line 2103 "dhcp4_parser.cc"
2103 break;
2104
2105 case 283: // $@44: %empty
2106#line 1161 "dhcp4_parser.yy"
2107 {
2108 ctx.unique("name", ctx.loc2pos(yystack_[0].location));
2109 ctx.enter(ctx.NO_KEYWORD);
2110}
2111#line 2112 "dhcp4_parser.cc"
2112 break;
2113
2114 case 284: // name: "name" $@44 ":" "constant string"
2115#line 1164 "dhcp4_parser.yy"
2116 {
2117 ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2118 ctx.stack_.back()->set("name", name);
2119 ctx.leave();
2120}
2121#line 2122 "dhcp4_parser.cc"
2122 break;
2123
2124 case 285: // persist: "persist" ":" "boolean"
2125#line 1170 "dhcp4_parser.yy"
2126 {
2127 ctx.unique("persist", ctx.loc2pos(yystack_[2].location));
2128 ElementPtr n(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
2129 ctx.stack_.back()->set("persist", n);
2130}
2131#line 2132 "dhcp4_parser.cc"
2132 break;
2133
2134 case 286: // lfc_interval: "lfc-interval" ":" "integer"
2135#line 1176 "dhcp4_parser.yy"
2136 {
2137 ctx.unique("lfc-interval", ctx.loc2pos(yystack_[2].location));
2138 ElementPtr n(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2139 ctx.stack_.back()->set("lfc-interval", n);
2140}
2141#line 2142 "dhcp4_parser.cc"
2142 break;
2143
2144 case 287: // readonly: "readonly" ":" "boolean"
2145#line 1182 "dhcp4_parser.yy"
2146 {
2147 ctx.unique("readonly", ctx.loc2pos(yystack_[2].location));
2148 ElementPtr n(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
2149 ctx.stack_.back()->set("readonly", n);
2150}
2151#line 2152 "dhcp4_parser.cc"
2152 break;
2153
2154 case 288: // connect_timeout: "connect-timeout" ":" "integer"
2155#line 1188 "dhcp4_parser.yy"
2156 {
2157 ctx.unique("connect-timeout", ctx.loc2pos(yystack_[2].location));
2158 ElementPtr n(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2159 ctx.stack_.back()->set("connect-timeout", n);
2160}
2161#line 2162 "dhcp4_parser.cc"
2162 break;
2163
2164 case 289: // read_timeout: "read-timeout" ":" "integer"
2165#line 1194 "dhcp4_parser.yy"
2166 {
2167 ctx.unique("read-timeout", ctx.loc2pos(yystack_[2].location));
2168 ElementPtr n(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2169 ctx.stack_.back()->set("read-timeout", n);
2170}
2171#line 2172 "dhcp4_parser.cc"
2172 break;
2173
2174 case 290: // write_timeout: "write-timeout" ":" "integer"
2175#line 1200 "dhcp4_parser.yy"
2176 {
2177 ctx.unique("write-timeout", ctx.loc2pos(yystack_[2].location));
2178 ElementPtr n(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2179 ctx.stack_.back()->set("write-timeout", n);
2180}
2181#line 2182 "dhcp4_parser.cc"
2182 break;
2183
2184 case 291: // tcp_user_timeout: "tcp-user-timeout" ":" "integer"
2185#line 1206 "dhcp4_parser.yy"
2186 {
2187 ctx.unique("tcp-user-timeout", ctx.loc2pos(yystack_[2].location));
2188 ElementPtr n(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2189 ctx.stack_.back()->set("tcp-user-timeout", n);
2190}
2191#line 2192 "dhcp4_parser.cc"
2192 break;
2193
2194 case 292: // max_reconnect_tries: "max-reconnect-tries" ":" "integer"
2195#line 1212 "dhcp4_parser.yy"
2196 {
2197 ctx.unique("max-reconnect-tries", ctx.loc2pos(yystack_[2].location));
2198 ElementPtr n(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2199 ctx.stack_.back()->set("max-reconnect-tries", n);
2200}
2201#line 2202 "dhcp4_parser.cc"
2202 break;
2203
2204 case 293: // reconnect_wait_time: "reconnect-wait-time" ":" "integer"
2205#line 1218 "dhcp4_parser.yy"
2206 {
2207 ctx.unique("reconnect-wait-time", ctx.loc2pos(yystack_[2].location));
2208 ElementPtr n(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2209 ctx.stack_.back()->set("reconnect-wait-time", n);
2210}
2211#line 2212 "dhcp4_parser.cc"
2212 break;
2213
2214 case 294: // $@45: %empty
2215#line 1224 "dhcp4_parser.yy"
2216 {
2217 ctx.unique("on-fail", ctx.loc2pos(yystack_[0].location));
2218 ctx.enter(ctx.DATABASE_ON_FAIL);
2219}
2220#line 2221 "dhcp4_parser.cc"
2221 break;
2222
2223 case 295: // on_fail: "on-fail" $@45 ":" on_fail_mode
2224#line 1227 "dhcp4_parser.yy"
2225 {
2226 ctx.stack_.back()->set("on-fail", yystack_[0].value.as < ElementPtr > ());
2227 ctx.leave();
2228}
2229#line 2230 "dhcp4_parser.cc"
2230 break;
2231
2232 case 296: // on_fail_mode: "stop-retry-exit"
2233#line 1232 "dhcp4_parser.yy"
2234 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("stop-retry-exit", ctx.loc2pos(yystack_[0].location))); }
2235#line 2236 "dhcp4_parser.cc"
2236 break;
2237
2238 case 297: // on_fail_mode: "serve-retry-exit"
2239#line 1233 "dhcp4_parser.yy"
2240 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("serve-retry-exit", ctx.loc2pos(yystack_[0].location))); }
2241#line 2242 "dhcp4_parser.cc"
2242 break;
2243
2244 case 298: // on_fail_mode: "serve-retry-continue"
2245#line 1234 "dhcp4_parser.yy"
2246 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("serve-retry-continue", ctx.loc2pos(yystack_[0].location))); }
2247#line 2248 "dhcp4_parser.cc"
2248 break;
2249
2250 case 299: // retry_on_startup: "retry-on-startup" ":" "boolean"
2251#line 1237 "dhcp4_parser.yy"
2252 {
2253 ctx.unique("retry-on-startup", ctx.loc2pos(yystack_[2].location));
2254 ElementPtr n(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
2255 ctx.stack_.back()->set("retry-on-startup", n);
2256}
2257#line 2258 "dhcp4_parser.cc"
2258 break;
2259
2260 case 300: // max_row_errors: "max-row-errors" ":" "integer"
2261#line 1243 "dhcp4_parser.yy"
2262 {
2263 ctx.unique("max-row-errors", ctx.loc2pos(yystack_[2].location));
2264 ElementPtr n(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2265 ctx.stack_.back()->set("max-row-errors", n);
2266}
2267#line 2268 "dhcp4_parser.cc"
2268 break;
2269
2270 case 301: // $@46: %empty
2271#line 1249 "dhcp4_parser.yy"
2272 {
2273 ctx.unique("trust-anchor", ctx.loc2pos(yystack_[0].location));
2274 ctx.enter(ctx.NO_KEYWORD);
2275}
2276#line 2277 "dhcp4_parser.cc"
2277 break;
2278
2279 case 302: // trust_anchor: "trust-anchor" $@46 ":" "constant string"
2280#line 1252 "dhcp4_parser.yy"
2281 {
2282 ElementPtr ca(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2283 ctx.stack_.back()->set("trust-anchor", ca);
2284 ctx.leave();
2285}
2286#line 2287 "dhcp4_parser.cc"
2287 break;
2288
2289 case 303: // $@47: %empty
2290#line 1258 "dhcp4_parser.yy"
2291 {
2292 ctx.unique("cert-file", ctx.loc2pos(yystack_[0].location));
2293 ctx.enter(ctx.NO_KEYWORD);
2294}
2295#line 2296 "dhcp4_parser.cc"
2296 break;
2297
2298 case 304: // cert_file: "cert-file" $@47 ":" "constant string"
2299#line 1261 "dhcp4_parser.yy"
2300 {
2301 ElementPtr cert(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2302 ctx.stack_.back()->set("cert-file", cert);
2303 ctx.leave();
2304}
2305#line 2306 "dhcp4_parser.cc"
2306 break;
2307
2308 case 305: // $@48: %empty
2309#line 1267 "dhcp4_parser.yy"
2310 {
2311 ctx.unique("key-file", ctx.loc2pos(yystack_[0].location));
2312 ctx.enter(ctx.NO_KEYWORD);
2313}
2314#line 2315 "dhcp4_parser.cc"
2315 break;
2316
2317 case 306: // key_file: "key-file" $@48 ":" "constant string"
2318#line 1270 "dhcp4_parser.yy"
2319 {
2320 ElementPtr key(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2321 ctx.stack_.back()->set("key-file", key);
2322 ctx.leave();
2323}
2324#line 2325 "dhcp4_parser.cc"
2325 break;
2326
2327 case 307: // $@49: %empty
2328#line 1276 "dhcp4_parser.yy"
2329 {
2330 ctx.unique("cipher-list", ctx.loc2pos(yystack_[0].location));
2331 ctx.enter(ctx.NO_KEYWORD);
2332}
2333#line 2334 "dhcp4_parser.cc"
2334 break;
2335
2336 case 308: // cipher_list: "cipher-list" $@49 ":" "constant string"
2337#line 1279 "dhcp4_parser.yy"
2338 {
2339 ElementPtr cl(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2340 ctx.stack_.back()->set("cipher-list", cl);
2341 ctx.leave();
2342}
2343#line 2344 "dhcp4_parser.cc"
2344 break;
2345
2346 case 309: // $@50: %empty
2347#line 1285 "dhcp4_parser.yy"
2348 {
2349 ctx.unique("host-reservation-identifiers", ctx.loc2pos(yystack_[0].location));
2350 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
2351 ctx.stack_.back()->set("host-reservation-identifiers", l);
2352 ctx.stack_.push_back(l);
2354}
2355#line 2356 "dhcp4_parser.cc"
2356 break;
2357
2358 case 310: // host_reservation_identifiers: "host-reservation-identifiers" $@50 ":" "[" host_reservation_identifiers_list "]"
2359#line 1291 "dhcp4_parser.yy"
2360 {
2361 ctx.stack_.pop_back();
2362 ctx.leave();
2363}
2364#line 2365 "dhcp4_parser.cc"
2365 break;
2366
2367 case 313: // host_reservation_identifiers_list: host_reservation_identifiers_list ","
2368#line 1298 "dhcp4_parser.yy"
2369 {
2370 ctx.warnAboutExtraCommas(yystack_[0].location);
2371 }
2372#line 2373 "dhcp4_parser.cc"
2373 break;
2374
2375 case 319: // duid_id: "duid"
2376#line 1310 "dhcp4_parser.yy"
2377 {
2378 ElementPtr duid(new StringElement("duid", ctx.loc2pos(yystack_[0].location)));
2379 ctx.stack_.back()->add(duid);
2380}
2381#line 2382 "dhcp4_parser.cc"
2382 break;
2383
2384 case 320: // hw_address_id: "hw-address"
2385#line 1315 "dhcp4_parser.yy"
2386 {
2387 ElementPtr hwaddr(new StringElement("hw-address", ctx.loc2pos(yystack_[0].location)));
2388 ctx.stack_.back()->add(hwaddr);
2389}
2390#line 2391 "dhcp4_parser.cc"
2391 break;
2392
2393 case 321: // circuit_id: "circuit-id"
2394#line 1320 "dhcp4_parser.yy"
2395 {
2396 ElementPtr circuit(new StringElement("circuit-id", ctx.loc2pos(yystack_[0].location)));
2397 ctx.stack_.back()->add(circuit);
2398}
2399#line 2400 "dhcp4_parser.cc"
2400 break;
2401
2402 case 322: // client_id: "client-id"
2403#line 1325 "dhcp4_parser.yy"
2404 {
2405 ElementPtr client(new StringElement("client-id", ctx.loc2pos(yystack_[0].location)));
2406 ctx.stack_.back()->add(client);
2407}
2408#line 2409 "dhcp4_parser.cc"
2409 break;
2410
2411 case 323: // flex_id: "flex-id"
2412#line 1330 "dhcp4_parser.yy"
2413 {
2414 ElementPtr flex_id(new StringElement("flex-id", ctx.loc2pos(yystack_[0].location)));
2415 ctx.stack_.back()->add(flex_id);
2416}
2417#line 2418 "dhcp4_parser.cc"
2418 break;
2419
2420 case 324: // $@51: %empty
2421#line 1337 "dhcp4_parser.yy"
2422 {
2423 ctx.unique("multi-threading", ctx.loc2pos(yystack_[0].location));
2424 ElementPtr mt(new MapElement(ctx.loc2pos(yystack_[0].location)));
2425 ctx.stack_.back()->set("multi-threading", mt);
2426 ctx.stack_.push_back(mt);
2427 ctx.enter(ctx.DHCP_MULTI_THREADING);
2428}
2429#line 2430 "dhcp4_parser.cc"
2430 break;
2431
2432 case 325: // dhcp_multi_threading: "multi-threading" $@51 ":" "{" multi_threading_params "}"
2433#line 1343 "dhcp4_parser.yy"
2434 {
2435 // The enable parameter is required.
2436 ctx.require("enable-multi-threading", ctx.loc2pos(yystack_[2].location), ctx.loc2pos(yystack_[0].location));
2437 ctx.stack_.pop_back();
2438 ctx.leave();
2439}
2440#line 2441 "dhcp4_parser.cc"
2441 break;
2442
2443 case 328: // multi_threading_params: multi_threading_params ","
2444#line 1352 "dhcp4_parser.yy"
2445 {
2446 ctx.warnAboutExtraCommas(yystack_[0].location);
2447 }
2448#line 2449 "dhcp4_parser.cc"
2449 break;
2450
2451 case 335: // enable_multi_threading: "enable-multi-threading" ":" "boolean"
2452#line 1365 "dhcp4_parser.yy"
2453 {
2454 ctx.unique("enable-multi-threading", ctx.loc2pos(yystack_[2].location));
2455 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
2456 ctx.stack_.back()->set("enable-multi-threading", b);
2457}
2458#line 2459 "dhcp4_parser.cc"
2459 break;
2460
2461 case 336: // thread_pool_size: "thread-pool-size" ":" "integer"
2462#line 1371 "dhcp4_parser.yy"
2463 {
2464 ctx.unique("thread-pool-size", ctx.loc2pos(yystack_[2].location));
2465 ElementPtr prf(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2466 ctx.stack_.back()->set("thread-pool-size", prf);
2467}
2468#line 2469 "dhcp4_parser.cc"
2469 break;
2470
2471 case 337: // packet_queue_size: "packet-queue-size" ":" "integer"
2472#line 1377 "dhcp4_parser.yy"
2473 {
2474 ctx.unique("packet-queue-size", ctx.loc2pos(yystack_[2].location));
2475 ElementPtr prf(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2476 ctx.stack_.back()->set("packet-queue-size", prf);
2477}
2478#line 2479 "dhcp4_parser.cc"
2479 break;
2480
2481 case 338: // $@52: %empty
2482#line 1383 "dhcp4_parser.yy"
2483 {
2484 ctx.unique("hooks-libraries", ctx.loc2pos(yystack_[0].location));
2485 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
2486 ctx.stack_.back()->set("hooks-libraries", l);
2487 ctx.stack_.push_back(l);
2488 ctx.enter(ctx.HOOKS_LIBRARIES);
2489}
2490#line 2491 "dhcp4_parser.cc"
2491 break;
2492
2493 case 339: // hooks_libraries: "hooks-libraries" $@52 ":" "[" hooks_libraries_list "]"
2494#line 1389 "dhcp4_parser.yy"
2495 {
2496 ctx.stack_.pop_back();
2497 ctx.leave();
2498}
2499#line 2500 "dhcp4_parser.cc"
2500 break;
2501
2502 case 344: // not_empty_hooks_libraries_list: not_empty_hooks_libraries_list ","
2503#line 1400 "dhcp4_parser.yy"
2504 {
2505 ctx.warnAboutExtraCommas(yystack_[0].location);
2506 }
2507#line 2508 "dhcp4_parser.cc"
2508 break;
2509
2510 case 345: // $@53: %empty
2511#line 1405 "dhcp4_parser.yy"
2512 {
2513 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
2514 ctx.stack_.back()->add(m);
2515 ctx.stack_.push_back(m);
2516}
2517#line 2518 "dhcp4_parser.cc"
2518 break;
2519
2520 case 346: // hooks_library: "{" $@53 hooks_params "}"
2521#line 1409 "dhcp4_parser.yy"
2522 {
2523 // The library hooks parameter is required
2524 ctx.require("library", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
2525 ctx.stack_.pop_back();
2526}
2527#line 2528 "dhcp4_parser.cc"
2528 break;
2529
2530 case 347: // $@54: %empty
2531#line 1415 "dhcp4_parser.yy"
2532 {
2533 // Parse the hooks-libraries list entry map
2534 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
2535 ctx.stack_.push_back(m);
2536}
2537#line 2538 "dhcp4_parser.cc"
2538 break;
2539
2540 case 348: // sub_hooks_library: "{" $@54 hooks_params "}"
2541#line 1419 "dhcp4_parser.yy"
2542 {
2543 // The library hooks parameter is required
2544 ctx.require("library", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
2545 // parsing completed
2546}
2547#line 2548 "dhcp4_parser.cc"
2548 break;
2549
2550 case 351: // hooks_params: hooks_params ","
2551#line 1427 "dhcp4_parser.yy"
2552 {
2553 ctx.warnAboutExtraCommas(yystack_[0].location);
2554 }
2555#line 2556 "dhcp4_parser.cc"
2556 break;
2557
2558 case 355: // $@55: %empty
2559#line 1437 "dhcp4_parser.yy"
2560 {
2561 ctx.unique("library", ctx.loc2pos(yystack_[0].location));
2562 ctx.enter(ctx.NO_KEYWORD);
2563}
2564#line 2565 "dhcp4_parser.cc"
2565 break;
2566
2567 case 356: // library: "library" $@55 ":" "constant string"
2568#line 1440 "dhcp4_parser.yy"
2569 {
2570 ElementPtr lib(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2571 ctx.stack_.back()->set("library", lib);
2572 ctx.leave();
2573}
2574#line 2575 "dhcp4_parser.cc"
2575 break;
2576
2577 case 357: // $@56: %empty
2578#line 1446 "dhcp4_parser.yy"
2579 {
2580 ctx.unique("parameters", ctx.loc2pos(yystack_[0].location));
2581 ctx.enter(ctx.NO_KEYWORD);
2582}
2583#line 2584 "dhcp4_parser.cc"
2584 break;
2585
2586 case 358: // parameters: "parameters" $@56 ":" map_value
2587#line 1449 "dhcp4_parser.yy"
2588 {
2589 ctx.stack_.back()->set("parameters", yystack_[0].value.as < ElementPtr > ());
2590 ctx.leave();
2591}
2592#line 2593 "dhcp4_parser.cc"
2593 break;
2594
2595 case 359: // $@57: %empty
2596#line 1455 "dhcp4_parser.yy"
2597 {
2598 ctx.unique("expired-leases-processing", ctx.loc2pos(yystack_[0].location));
2599 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
2600 ctx.stack_.back()->set("expired-leases-processing", m);
2601 ctx.stack_.push_back(m);
2603}
2604#line 2605 "dhcp4_parser.cc"
2605 break;
2606
2607 case 360: // expired_leases_processing: "expired-leases-processing" $@57 ":" "{" expired_leases_params "}"
2608#line 1461 "dhcp4_parser.yy"
2609 {
2610 // No expired lease parameter is required
2611 ctx.stack_.pop_back();
2612 ctx.leave();
2613}
2614#line 2615 "dhcp4_parser.cc"
2615 break;
2616
2617 case 363: // expired_leases_params: expired_leases_params ","
2618#line 1469 "dhcp4_parser.yy"
2619 {
2620 ctx.warnAboutExtraCommas(yystack_[0].location);
2621 }
2622#line 2623 "dhcp4_parser.cc"
2623 break;
2624
2625 case 370: // reclaim_timer_wait_time: "reclaim-timer-wait-time" ":" "integer"
2626#line 1482 "dhcp4_parser.yy"
2627 {
2628 ctx.unique("reclaim-timer-wait-time", ctx.loc2pos(yystack_[2].location));
2629 ElementPtr value(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2630 ctx.stack_.back()->set("reclaim-timer-wait-time", value);
2631}
2632#line 2633 "dhcp4_parser.cc"
2633 break;
2634
2635 case 371: // flush_reclaimed_timer_wait_time: "flush-reclaimed-timer-wait-time" ":" "integer"
2636#line 1488 "dhcp4_parser.yy"
2637 {
2638 ctx.unique("flush-reclaimed-timer-wait-time", ctx.loc2pos(yystack_[2].location));
2639 ElementPtr value(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2640 ctx.stack_.back()->set("flush-reclaimed-timer-wait-time", value);
2641}
2642#line 2643 "dhcp4_parser.cc"
2643 break;
2644
2645 case 372: // hold_reclaimed_time: "hold-reclaimed-time" ":" "integer"
2646#line 1494 "dhcp4_parser.yy"
2647 {
2648 ctx.unique("hold-reclaimed-time", ctx.loc2pos(yystack_[2].location));
2649 ElementPtr value(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2650 ctx.stack_.back()->set("hold-reclaimed-time", value);
2651}
2652#line 2653 "dhcp4_parser.cc"
2653 break;
2654
2655 case 373: // max_reclaim_leases: "max-reclaim-leases" ":" "integer"
2656#line 1500 "dhcp4_parser.yy"
2657 {
2658 ctx.unique("max-reclaim-leases", ctx.loc2pos(yystack_[2].location));
2659 ElementPtr value(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2660 ctx.stack_.back()->set("max-reclaim-leases", value);
2661}
2662#line 2663 "dhcp4_parser.cc"
2663 break;
2664
2665 case 374: // max_reclaim_time: "max-reclaim-time" ":" "integer"
2666#line 1506 "dhcp4_parser.yy"
2667 {
2668 ctx.unique("max-reclaim-time", ctx.loc2pos(yystack_[2].location));
2669 ElementPtr value(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2670 ctx.stack_.back()->set("max-reclaim-time", value);
2671}
2672#line 2673 "dhcp4_parser.cc"
2673 break;
2674
2675 case 375: // unwarned_reclaim_cycles: "unwarned-reclaim-cycles" ":" "integer"
2676#line 1512 "dhcp4_parser.yy"
2677 {
2678 ctx.unique("unwarned-reclaim-cycles", ctx.loc2pos(yystack_[2].location));
2679 ElementPtr value(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2680 ctx.stack_.back()->set("unwarned-reclaim-cycles", value);
2681}
2682#line 2683 "dhcp4_parser.cc"
2683 break;
2684
2685 case 376: // $@58: %empty
2686#line 1521 "dhcp4_parser.yy"
2687 {
2688 ctx.unique("subnet4", ctx.loc2pos(yystack_[0].location));
2689 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
2690 ctx.stack_.back()->set("subnet4", l);
2691 ctx.stack_.push_back(l);
2692 ctx.enter(ctx.SUBNET4);
2693}
2694#line 2695 "dhcp4_parser.cc"
2695 break;
2696
2697 case 377: // subnet4_list: "subnet4" $@58 ":" "[" subnet4_list_content "]"
2698#line 1527 "dhcp4_parser.yy"
2699 {
2700 ctx.stack_.pop_back();
2701 ctx.leave();
2702}
2703#line 2704 "dhcp4_parser.cc"
2704 break;
2705
2706 case 382: // not_empty_subnet4_list: not_empty_subnet4_list ","
2707#line 1541 "dhcp4_parser.yy"
2708 {
2709 ctx.warnAboutExtraCommas(yystack_[0].location);
2710 }
2711#line 2712 "dhcp4_parser.cc"
2712 break;
2713
2714 case 383: // $@59: %empty
2715#line 1550 "dhcp4_parser.yy"
2716 {
2717 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
2718 ctx.stack_.back()->add(m);
2719 ctx.stack_.push_back(m);
2720}
2721#line 2722 "dhcp4_parser.cc"
2722 break;
2723
2724 case 384: // subnet4: "{" $@59 subnet4_params "}"
2725#line 1554 "dhcp4_parser.yy"
2726 {
2727 // Once we reached this place, the subnet parsing is now complete.
2728 // If we want to, we can implement default values here.
2729 // In particular we can do things like this:
2730 // if (!ctx.stack_.back()->get("interface")) {
2731 // ctx.stack_.back()->set("interface", StringElement("loopback"));
2732 // }
2733 //
2734 // We can also stack up one level (Dhcp4) and copy over whatever
2735 // global parameters we want to:
2736 // if (!ctx.stack_.back()->get("renew-timer")) {
2737 // ElementPtr renew = ctx_stack_[...].get("renew-timer");
2738 // if (renew) {
2739 // ctx.stack_.back()->set("renew-timer", renew);
2740 // }
2741 // }
2742
2743 // The subnet subnet4 parameter is required
2744 ctx.require("subnet", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
2745 ctx.stack_.pop_back();
2746}
2747#line 2748 "dhcp4_parser.cc"
2748 break;
2749
2750 case 385: // $@60: %empty
2751#line 1576 "dhcp4_parser.yy"
2752 {
2753 // Parse the subnet4 list entry map
2754 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
2755 ctx.stack_.push_back(m);
2756}
2757#line 2758 "dhcp4_parser.cc"
2758 break;
2759
2760 case 386: // sub_subnet4: "{" $@60 subnet4_params "}"
2761#line 1580 "dhcp4_parser.yy"
2762 {
2763 // The subnet subnet4 parameter is required
2764 ctx.require("subnet", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
2765 // parsing completed
2766}
2767#line 2768 "dhcp4_parser.cc"
2768 break;
2769
2770 case 389: // subnet4_params: subnet4_params ","
2771#line 1589 "dhcp4_parser.yy"
2772 {
2773 ctx.warnAboutExtraCommas(yystack_[0].location);
2774 }
2775#line 2776 "dhcp4_parser.cc"
2776 break;
2777
2778 case 440: // $@61: %empty
2779#line 1647 "dhcp4_parser.yy"
2780 {
2781 ctx.unique("subnet", ctx.loc2pos(yystack_[0].location));
2782 ctx.enter(ctx.NO_KEYWORD);
2783}
2784#line 2785 "dhcp4_parser.cc"
2785 break;
2786
2787 case 441: // subnet: "subnet" $@61 ":" "constant string"
2788#line 1650 "dhcp4_parser.yy"
2789 {
2790 ElementPtr subnet(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2791 ctx.stack_.back()->set("subnet", subnet);
2792 ctx.leave();
2793}
2794#line 2795 "dhcp4_parser.cc"
2795 break;
2796
2797 case 442: // $@62: %empty
2798#line 1656 "dhcp4_parser.yy"
2799 {
2800 ctx.unique("4o6-interface", ctx.loc2pos(yystack_[0].location));
2801 ctx.enter(ctx.NO_KEYWORD);
2802}
2803#line 2804 "dhcp4_parser.cc"
2804 break;
2805
2806 case 443: // subnet_4o6_interface: "4o6-interface" $@62 ":" "constant string"
2807#line 1659 "dhcp4_parser.yy"
2808 {
2809 ElementPtr iface(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2810 ctx.stack_.back()->set("4o6-interface", iface);
2811 ctx.leave();
2812}
2813#line 2814 "dhcp4_parser.cc"
2814 break;
2815
2816 case 444: // $@63: %empty
2817#line 1665 "dhcp4_parser.yy"
2818 {
2819 ctx.unique("4o6-interface-id", ctx.loc2pos(yystack_[0].location));
2820 ctx.enter(ctx.NO_KEYWORD);
2821}
2822#line 2823 "dhcp4_parser.cc"
2823 break;
2824
2825 case 445: // subnet_4o6_interface_id: "4o6-interface-id" $@63 ":" "constant string"
2826#line 1668 "dhcp4_parser.yy"
2827 {
2828 ElementPtr iface(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2829 ctx.stack_.back()->set("4o6-interface-id", iface);
2830 ctx.leave();
2831}
2832#line 2833 "dhcp4_parser.cc"
2833 break;
2834
2835 case 446: // $@64: %empty
2836#line 1674 "dhcp4_parser.yy"
2837 {
2838 ctx.unique("4o6-subnet", ctx.loc2pos(yystack_[0].location));
2839 ctx.enter(ctx.NO_KEYWORD);
2840}
2841#line 2842 "dhcp4_parser.cc"
2842 break;
2843
2844 case 447: // subnet_4o6_subnet: "4o6-subnet" $@64 ":" "constant string"
2845#line 1677 "dhcp4_parser.yy"
2846 {
2847 ElementPtr iface(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2848 ctx.stack_.back()->set("4o6-subnet", iface);
2849 ctx.leave();
2850}
2851#line 2852 "dhcp4_parser.cc"
2852 break;
2853
2854 case 448: // $@65: %empty
2855#line 1683 "dhcp4_parser.yy"
2856 {
2857 ctx.unique("interface", ctx.loc2pos(yystack_[0].location));
2858 ctx.enter(ctx.NO_KEYWORD);
2859}
2860#line 2861 "dhcp4_parser.cc"
2861 break;
2862
2863 case 449: // interface: "interface" $@65 ":" "constant string"
2864#line 1686 "dhcp4_parser.yy"
2865 {
2866 ElementPtr iface(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2867 ctx.stack_.back()->set("interface", iface);
2868 ctx.leave();
2869}
2870#line 2871 "dhcp4_parser.cc"
2871 break;
2872
2873 case 450: // $@66: %empty
2874#line 1692 "dhcp4_parser.yy"
2875 {
2876 ctx.unique("client-class", ctx.loc2pos(yystack_[0].location));
2877 ctx.enter(ctx.NO_KEYWORD);
2878}
2879#line 2880 "dhcp4_parser.cc"
2880 break;
2881
2882 case 451: // client_class: "client-class" $@66 ":" "constant string"
2883#line 1695 "dhcp4_parser.yy"
2884 {
2885 ElementPtr cls(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
2886 ctx.stack_.back()->set("client-class", cls);
2887 ctx.leave();
2888}
2889#line 2890 "dhcp4_parser.cc"
2890 break;
2891
2892 case 452: // $@67: %empty
2893#line 1702 "dhcp4_parser.yy"
2894 {
2895 ctx.unique("client-classes", ctx.loc2pos(yystack_[0].location));
2896 ElementPtr c(new ListElement(ctx.loc2pos(yystack_[0].location)));
2897 ctx.stack_.back()->set("client-classes", c);
2898 ctx.stack_.push_back(c);
2899 ctx.enter(ctx.NO_KEYWORD);
2900}
2901#line 2902 "dhcp4_parser.cc"
2902 break;
2903
2904 case 453: // network_client_classes: "client-classes" $@67 ":" list_strings
2905#line 1708 "dhcp4_parser.yy"
2906 {
2907 ctx.stack_.pop_back();
2908 ctx.leave();
2909}
2910#line 2911 "dhcp4_parser.cc"
2911 break;
2912
2913 case 454: // $@68: %empty
2914#line 1714 "dhcp4_parser.yy"
2915 {
2916 ctx.unique("require-client-classes", ctx.loc2pos(yystack_[0].location));
2917 ElementPtr c(new ListElement(ctx.loc2pos(yystack_[0].location)));
2918 ctx.stack_.back()->set("require-client-classes", c);
2919 ctx.stack_.push_back(c);
2920 ctx.enter(ctx.NO_KEYWORD);
2921}
2922#line 2923 "dhcp4_parser.cc"
2923 break;
2924
2925 case 455: // require_client_classes: "require-client-classes" $@68 ":" list_strings
2926#line 1720 "dhcp4_parser.yy"
2927 {
2928 ctx.stack_.pop_back();
2929 ctx.leave();
2930}
2931#line 2932 "dhcp4_parser.cc"
2932 break;
2933
2934 case 456: // $@69: %empty
2935#line 1725 "dhcp4_parser.yy"
2936 {
2937 ctx.unique("evaluate-additional-classes", ctx.loc2pos(yystack_[0].location));
2938 ElementPtr c(new ListElement(ctx.loc2pos(yystack_[0].location)));
2939 ctx.stack_.back()->set("evaluate-additional-classes", c);
2940 ctx.stack_.push_back(c);
2941 ctx.enter(ctx.NO_KEYWORD);
2942}
2943#line 2944 "dhcp4_parser.cc"
2944 break;
2945
2946 case 457: // evaluate_additional_classes: "evaluate-additional-classes" $@69 ":" list_strings
2947#line 1731 "dhcp4_parser.yy"
2948 {
2949 ctx.stack_.pop_back();
2950 ctx.leave();
2951}
2952#line 2953 "dhcp4_parser.cc"
2953 break;
2954
2955 case 458: // reservations_global: "reservations-global" ":" "boolean"
2956#line 1736 "dhcp4_parser.yy"
2957 {
2958 ctx.unique("reservations-global", ctx.loc2pos(yystack_[2].location));
2959 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
2960 ctx.stack_.back()->set("reservations-global", b);
2961}
2962#line 2963 "dhcp4_parser.cc"
2963 break;
2964
2965 case 459: // reservations_in_subnet: "reservations-in-subnet" ":" "boolean"
2966#line 1742 "dhcp4_parser.yy"
2967 {
2968 ctx.unique("reservations-in-subnet", ctx.loc2pos(yystack_[2].location));
2969 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
2970 ctx.stack_.back()->set("reservations-in-subnet", b);
2971}
2972#line 2973 "dhcp4_parser.cc"
2973 break;
2974
2975 case 460: // reservations_out_of_pool: "reservations-out-of-pool" ":" "boolean"
2976#line 1748 "dhcp4_parser.yy"
2977 {
2978 ctx.unique("reservations-out-of-pool", ctx.loc2pos(yystack_[2].location));
2979 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
2980 ctx.stack_.back()->set("reservations-out-of-pool", b);
2981}
2982#line 2983 "dhcp4_parser.cc"
2983 break;
2984
2985 case 461: // id: "id" ":" "integer"
2986#line 1754 "dhcp4_parser.yy"
2987 {
2988 ctx.unique("id", ctx.loc2pos(yystack_[2].location));
2989 ElementPtr id(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
2990 ctx.stack_.back()->set("id", id);
2991}
2992#line 2993 "dhcp4_parser.cc"
2993 break;
2994
2995 case 462: // $@70: %empty
2996#line 1762 "dhcp4_parser.yy"
2997 {
2998 ctx.unique("shared-networks", ctx.loc2pos(yystack_[0].location));
2999 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
3000 ctx.stack_.back()->set("shared-networks", l);
3001 ctx.stack_.push_back(l);
3002 ctx.enter(ctx.SHARED_NETWORK);
3003}
3004#line 3005 "dhcp4_parser.cc"
3005 break;
3006
3007 case 463: // shared_networks: "shared-networks" $@70 ":" "[" shared_networks_content "]"
3008#line 1768 "dhcp4_parser.yy"
3009 {
3010 ctx.stack_.pop_back();
3011 ctx.leave();
3012}
3013#line 3014 "dhcp4_parser.cc"
3014 break;
3015
3016 case 468: // shared_networks_list: shared_networks_list ","
3017#line 1781 "dhcp4_parser.yy"
3018 {
3019 ctx.warnAboutExtraCommas(yystack_[0].location);
3020 }
3021#line 3022 "dhcp4_parser.cc"
3022 break;
3023
3024 case 469: // $@71: %empty
3025#line 1786 "dhcp4_parser.yy"
3026 {
3027 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
3028 ctx.stack_.back()->add(m);
3029 ctx.stack_.push_back(m);
3030}
3031#line 3032 "dhcp4_parser.cc"
3032 break;
3033
3034 case 470: // shared_network: "{" $@71 shared_network_params "}"
3035#line 1790 "dhcp4_parser.yy"
3036 {
3037 ctx.stack_.pop_back();
3038}
3039#line 3040 "dhcp4_parser.cc"
3040 break;
3041
3042 case 473: // shared_network_params: shared_network_params ","
3043#line 1796 "dhcp4_parser.yy"
3044 {
3045 ctx.warnAboutExtraCommas(yystack_[0].location);
3046 }
3047#line 3048 "dhcp4_parser.cc"
3048 break;
3049
3050 case 519: // $@72: %empty
3051#line 1852 "dhcp4_parser.yy"
3052 {
3053 ctx.unique("option-def", ctx.loc2pos(yystack_[0].location));
3054 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
3055 ctx.stack_.back()->set("option-def", l);
3056 ctx.stack_.push_back(l);
3057 ctx.enter(ctx.OPTION_DEF);
3058}
3059#line 3060 "dhcp4_parser.cc"
3060 break;
3061
3062 case 520: // option_def_list: "option-def" $@72 ":" "[" option_def_list_content "]"
3063#line 1858 "dhcp4_parser.yy"
3064 {
3065 ctx.stack_.pop_back();
3066 ctx.leave();
3067}
3068#line 3069 "dhcp4_parser.cc"
3069 break;
3070
3071 case 521: // $@73: %empty
3072#line 1866 "dhcp4_parser.yy"
3073 {
3074 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
3075 ctx.stack_.push_back(m);
3076}
3077#line 3078 "dhcp4_parser.cc"
3078 break;
3079
3080 case 522: // sub_option_def_list: "{" $@73 option_def_list "}"
3081#line 1869 "dhcp4_parser.yy"
3082 {
3083 // parsing completed
3084}
3085#line 3086 "dhcp4_parser.cc"
3086 break;
3087
3088 case 527: // not_empty_option_def_list: not_empty_option_def_list ","
3089#line 1881 "dhcp4_parser.yy"
3090 {
3091 ctx.warnAboutExtraCommas(yystack_[0].location);
3092 }
3093#line 3094 "dhcp4_parser.cc"
3094 break;
3095
3096 case 528: // $@74: %empty
3097#line 1888 "dhcp4_parser.yy"
3098 {
3099 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
3100 ctx.stack_.back()->add(m);
3101 ctx.stack_.push_back(m);
3102}
3103#line 3104 "dhcp4_parser.cc"
3104 break;
3105
3106 case 529: // option_def_entry: "{" $@74 option_def_params "}"
3107#line 1892 "dhcp4_parser.yy"
3108 {
3109 // The name, code and type option def parameters are required.
3110 ctx.require("name", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
3111 ctx.require("code", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
3112 ctx.require("type", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
3113 ctx.stack_.pop_back();
3114}
3115#line 3116 "dhcp4_parser.cc"
3116 break;
3117
3118 case 530: // $@75: %empty
3119#line 1903 "dhcp4_parser.yy"
3120 {
3121 // Parse the option-def list entry map
3122 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
3123 ctx.stack_.push_back(m);
3124}
3125#line 3126 "dhcp4_parser.cc"
3126 break;
3127
3128 case 531: // sub_option_def: "{" $@75 option_def_params "}"
3129#line 1907 "dhcp4_parser.yy"
3130 {
3131 // The name, code and type option def parameters are required.
3132 ctx.require("name", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
3133 ctx.require("code", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
3134 ctx.require("type", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
3135 // parsing completed
3136}
3137#line 3138 "dhcp4_parser.cc"
3138 break;
3139
3140 case 536: // not_empty_option_def_params: not_empty_option_def_params ","
3141#line 1923 "dhcp4_parser.yy"
3142 {
3143 ctx.warnAboutExtraCommas(yystack_[0].location);
3144 }
3145#line 3146 "dhcp4_parser.cc"
3146 break;
3147
3148 case 548: // code: "code" ":" "integer"
3149#line 1942 "dhcp4_parser.yy"
3150 {
3151 ctx.unique("code", ctx.loc2pos(yystack_[2].location));
3152 ElementPtr code(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
3153 ctx.stack_.back()->set("code", code);
3154}
3155#line 3156 "dhcp4_parser.cc"
3156 break;
3157
3158 case 550: // $@76: %empty
3159#line 1950 "dhcp4_parser.yy"
3160 {
3161 ctx.unique("type", ctx.loc2pos(yystack_[0].location));
3162 ctx.enter(ctx.NO_KEYWORD);
3163}
3164#line 3165 "dhcp4_parser.cc"
3165 break;
3166
3167 case 551: // option_def_type: "type" $@76 ":" "constant string"
3168#line 1953 "dhcp4_parser.yy"
3169 {
3170 ElementPtr prf(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3171 ctx.stack_.back()->set("type", prf);
3172 ctx.leave();
3173}
3174#line 3175 "dhcp4_parser.cc"
3175 break;
3176
3177 case 552: // $@77: %empty
3178#line 1959 "dhcp4_parser.yy"
3179 {
3180 ctx.unique("record-types", ctx.loc2pos(yystack_[0].location));
3181 ctx.enter(ctx.NO_KEYWORD);
3182}
3183#line 3184 "dhcp4_parser.cc"
3184 break;
3185
3186 case 553: // option_def_record_types: "record-types" $@77 ":" "constant string"
3187#line 1962 "dhcp4_parser.yy"
3188 {
3189 ElementPtr rtypes(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3190 ctx.stack_.back()->set("record-types", rtypes);
3191 ctx.leave();
3192}
3193#line 3194 "dhcp4_parser.cc"
3194 break;
3195
3196 case 554: // $@78: %empty
3197#line 1968 "dhcp4_parser.yy"
3198 {
3199 ctx.unique("space", ctx.loc2pos(yystack_[0].location));
3200 ctx.enter(ctx.NO_KEYWORD);
3201}
3202#line 3203 "dhcp4_parser.cc"
3203 break;
3204
3205 case 555: // space: "space" $@78 ":" "constant string"
3206#line 1971 "dhcp4_parser.yy"
3207 {
3208 ElementPtr space(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3209 ctx.stack_.back()->set("space", space);
3210 ctx.leave();
3211}
3212#line 3213 "dhcp4_parser.cc"
3213 break;
3214
3215 case 557: // $@79: %empty
3216#line 1979 "dhcp4_parser.yy"
3217 {
3218 ctx.unique("encapsulate", ctx.loc2pos(yystack_[0].location));
3219 ctx.enter(ctx.NO_KEYWORD);
3220}
3221#line 3222 "dhcp4_parser.cc"
3222 break;
3223
3224 case 558: // option_def_encapsulate: "encapsulate" $@79 ":" "constant string"
3225#line 1982 "dhcp4_parser.yy"
3226 {
3227 ElementPtr encap(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3228 ctx.stack_.back()->set("encapsulate", encap);
3229 ctx.leave();
3230}
3231#line 3232 "dhcp4_parser.cc"
3232 break;
3233
3234 case 559: // option_def_array: "array" ":" "boolean"
3235#line 1988 "dhcp4_parser.yy"
3236 {
3237 ctx.unique("array", ctx.loc2pos(yystack_[2].location));
3238 ElementPtr array(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
3239 ctx.stack_.back()->set("array", array);
3240}
3241#line 3242 "dhcp4_parser.cc"
3242 break;
3243
3244 case 560: // $@80: %empty
3245#line 1998 "dhcp4_parser.yy"
3246 {
3247 ctx.unique("option-data", ctx.loc2pos(yystack_[0].location));
3248 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
3249 ctx.stack_.back()->set("option-data", l);
3250 ctx.stack_.push_back(l);
3251 ctx.enter(ctx.OPTION_DATA);
3252}
3253#line 3254 "dhcp4_parser.cc"
3254 break;
3255
3256 case 561: // option_data_list: "option-data" $@80 ":" "[" option_data_list_content "]"
3257#line 2004 "dhcp4_parser.yy"
3258 {
3259 ctx.stack_.pop_back();
3260 ctx.leave();
3261}
3262#line 3263 "dhcp4_parser.cc"
3263 break;
3264
3265 case 566: // not_empty_option_data_list: not_empty_option_data_list ","
3266#line 2019 "dhcp4_parser.yy"
3267 {
3268 ctx.warnAboutExtraCommas(yystack_[0].location);
3269 }
3270#line 3271 "dhcp4_parser.cc"
3271 break;
3272
3273 case 567: // $@81: %empty
3274#line 2026 "dhcp4_parser.yy"
3275 {
3276 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
3277 ctx.stack_.back()->add(m);
3278 ctx.stack_.push_back(m);
3279}
3280#line 3281 "dhcp4_parser.cc"
3281 break;
3282
3283 case 568: // option_data_entry: "{" $@81 option_data_params "}"
3284#line 2030 "dhcp4_parser.yy"
3285 {
3287 ctx.stack_.pop_back();
3288}
3289#line 3290 "dhcp4_parser.cc"
3290 break;
3291
3292 case 569: // $@82: %empty
3293#line 2038 "dhcp4_parser.yy"
3294 {
3295 // Parse the option-data list entry map
3296 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
3297 ctx.stack_.push_back(m);
3298}
3299#line 3300 "dhcp4_parser.cc"
3300 break;
3301
3302 case 570: // sub_option_data: "{" $@82 option_data_params "}"
3303#line 2042 "dhcp4_parser.yy"
3304 {
3306 // parsing completed
3307}
3308#line 3309 "dhcp4_parser.cc"
3309 break;
3310
3311 case 575: // not_empty_option_data_params: not_empty_option_data_params ","
3312#line 2058 "dhcp4_parser.yy"
3313 {
3314 ctx.warnAboutExtraCommas(yystack_[0].location);
3315 }
3316#line 3317 "dhcp4_parser.cc"
3317 break;
3318
3319 case 588: // $@83: %empty
3320#line 2080 "dhcp4_parser.yy"
3321 {
3322 ctx.unique("data", ctx.loc2pos(yystack_[0].location));
3323 ctx.enter(ctx.NO_KEYWORD);
3324}
3325#line 3326 "dhcp4_parser.cc"
3326 break;
3327
3328 case 589: // option_data_data: "data" $@83 ":" "constant string"
3329#line 2083 "dhcp4_parser.yy"
3330 {
3331 ElementPtr data(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3332 ctx.stack_.back()->set("data", data);
3333 ctx.leave();
3334}
3335#line 3336 "dhcp4_parser.cc"
3336 break;
3337
3338 case 592: // option_data_csv_format: "csv-format" ":" "boolean"
3339#line 2093 "dhcp4_parser.yy"
3340 {
3341 ctx.unique("csv-format", ctx.loc2pos(yystack_[2].location));
3342 ElementPtr csv(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
3343 ctx.stack_.back()->set("csv-format", csv);
3344}
3345#line 3346 "dhcp4_parser.cc"
3346 break;
3347
3348 case 593: // option_data_always_send: "always-send" ":" "boolean"
3349#line 2099 "dhcp4_parser.yy"
3350 {
3351 ctx.unique("always-send", ctx.loc2pos(yystack_[2].location));
3352 ElementPtr persist(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
3353 ctx.stack_.back()->set("always-send", persist);
3354}
3355#line 3356 "dhcp4_parser.cc"
3356 break;
3357
3358 case 594: // option_data_never_send: "never-send" ":" "boolean"
3359#line 2105 "dhcp4_parser.yy"
3360 {
3361 ctx.unique("never-send", ctx.loc2pos(yystack_[2].location));
3362 ElementPtr cancel(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
3363 ctx.stack_.back()->set("never-send", cancel);
3364}
3365#line 3366 "dhcp4_parser.cc"
3366 break;
3367
3368 case 595: // $@84: %empty
3369#line 2111 "dhcp4_parser.yy"
3370 {
3371 ctx.unique("client-classes", ctx.loc2pos(yystack_[0].location));
3372 ElementPtr c(new ListElement(ctx.loc2pos(yystack_[0].location)));
3373 ctx.stack_.back()->set("client-classes", c);
3374 ctx.stack_.push_back(c);
3375 ctx.enter(ctx.NO_KEYWORD);
3376}
3377#line 3378 "dhcp4_parser.cc"
3378 break;
3379
3380 case 596: // option_data_client_classes: "client-classes" $@84 ":" list_strings
3381#line 2117 "dhcp4_parser.yy"
3382 {
3383 ctx.stack_.pop_back();
3384 ctx.leave();
3385}
3386#line 3387 "dhcp4_parser.cc"
3387 break;
3388
3389 case 597: // $@85: %empty
3390#line 2125 "dhcp4_parser.yy"
3391 {
3392 ctx.unique("pools", ctx.loc2pos(yystack_[0].location));
3393 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
3394 ctx.stack_.back()->set("pools", l);
3395 ctx.stack_.push_back(l);
3396 ctx.enter(ctx.POOLS);
3397}
3398#line 3399 "dhcp4_parser.cc"
3399 break;
3400
3401 case 598: // pools_list: "pools" $@85 ":" "[" pools_list_content "]"
3402#line 2131 "dhcp4_parser.yy"
3403 {
3404 ctx.stack_.pop_back();
3405 ctx.leave();
3406}
3407#line 3408 "dhcp4_parser.cc"
3408 break;
3409
3410 case 603: // not_empty_pools_list: not_empty_pools_list ","
3411#line 2144 "dhcp4_parser.yy"
3412 {
3413 ctx.warnAboutExtraCommas(yystack_[0].location);
3414 }
3415#line 3416 "dhcp4_parser.cc"
3416 break;
3417
3418 case 604: // $@86: %empty
3419#line 2149 "dhcp4_parser.yy"
3420 {
3421 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
3422 ctx.stack_.back()->add(m);
3423 ctx.stack_.push_back(m);
3424}
3425#line 3426 "dhcp4_parser.cc"
3426 break;
3427
3428 case 605: // pool_list_entry: "{" $@86 pool_params "}"
3429#line 2153 "dhcp4_parser.yy"
3430 {
3431 // The pool parameter is required.
3432 ctx.require("pool", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
3433 ctx.stack_.pop_back();
3434}
3435#line 3436 "dhcp4_parser.cc"
3436 break;
3437
3438 case 606: // $@87: %empty
3439#line 2159 "dhcp4_parser.yy"
3440 {
3441 // Parse the pool list entry map
3442 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
3443 ctx.stack_.push_back(m);
3444}
3445#line 3446 "dhcp4_parser.cc"
3446 break;
3447
3448 case 607: // sub_pool4: "{" $@87 pool_params "}"
3449#line 2163 "dhcp4_parser.yy"
3450 {
3451 // The pool parameter is required.
3452 ctx.require("pool", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
3453 // parsing completed
3454}
3455#line 3456 "dhcp4_parser.cc"
3456 break;
3457
3458 case 610: // pool_params: pool_params ","
3459#line 2171 "dhcp4_parser.yy"
3460 {
3461 ctx.warnAboutExtraCommas(yystack_[0].location);
3462 }
3463#line 3464 "dhcp4_parser.cc"
3464 break;
3465
3466 case 621: // $@88: %empty
3467#line 2188 "dhcp4_parser.yy"
3468 {
3469 ctx.unique("pool", ctx.loc2pos(yystack_[0].location));
3470 ctx.enter(ctx.NO_KEYWORD);
3471}
3472#line 3473 "dhcp4_parser.cc"
3473 break;
3474
3475 case 622: // pool_entry: "pool" $@88 ":" "constant string"
3476#line 2191 "dhcp4_parser.yy"
3477 {
3478 ElementPtr pool(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3479 ctx.stack_.back()->set("pool", pool);
3480 ctx.leave();
3481}
3482#line 3483 "dhcp4_parser.cc"
3483 break;
3484
3485 case 623: // pool_id: "pool-id" ":" "integer"
3486#line 2197 "dhcp4_parser.yy"
3487 {
3488 ctx.unique("pool-id", ctx.loc2pos(yystack_[2].location));
3489 ElementPtr id(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
3490 ctx.stack_.back()->set("pool-id", id);
3491}
3492#line 3493 "dhcp4_parser.cc"
3493 break;
3494
3495 case 624: // $@89: %empty
3496#line 2203 "dhcp4_parser.yy"
3497 {
3498 ctx.enter(ctx.NO_KEYWORD);
3499}
3500#line 3501 "dhcp4_parser.cc"
3501 break;
3502
3503 case 625: // user_context: "user-context" $@89 ":" map_value
3504#line 2205 "dhcp4_parser.yy"
3505 {
3506 ElementPtr parent = ctx.stack_.back();
3507 ElementPtr user_context = yystack_[0].value.as < ElementPtr > ();
3508 ConstElementPtr old = parent->get("user-context");
3509
3510 // Handle already existing user context
3511 if (old) {
3512 // Check if it was a comment or a duplicate
3513 if ((old->size() != 1) || !old->contains("comment")) {
3514 std::stringstream msg;
3515 msg << "duplicate user-context entries (previous at "
3516 << old->getPosition().str() << ")";
3517 error(yystack_[3].location, msg.str());
3518 }
3519 // Merge the comment
3520 user_context->set("comment", old->get("comment"));
3521 }
3522
3523 // Set the user context
3524 parent->set("user-context", user_context);
3525 ctx.leave();
3526}
3527#line 3528 "dhcp4_parser.cc"
3528 break;
3529
3530 case 626: // $@90: %empty
3531#line 2228 "dhcp4_parser.yy"
3532 {
3533 ctx.enter(ctx.NO_KEYWORD);
3534}
3535#line 3536 "dhcp4_parser.cc"
3536 break;
3537
3538 case 627: // comment: "comment" $@90 ":" "constant string"
3539#line 2230 "dhcp4_parser.yy"
3540 {
3541 ElementPtr parent = ctx.stack_.back();
3542 ElementPtr user_context(new MapElement(ctx.loc2pos(yystack_[3].location)));
3543 ElementPtr comment(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3544 user_context->set("comment", comment);
3545
3546 // Handle already existing user context
3547 ConstElementPtr old = parent->get("user-context");
3548 if (old) {
3549 // Check for duplicate comment
3550 if (old->contains("comment")) {
3551 std::stringstream msg;
3552 msg << "duplicate user-context/comment entries (previous at "
3553 << old->getPosition().str() << ")";
3554 error(yystack_[3].location, msg.str());
3555 }
3556 // Merge the user context in the comment
3557 merge(user_context, old);
3558 }
3559
3560 // Set the user context
3561 parent->set("user-context", user_context);
3562 ctx.leave();
3563}
3564#line 3565 "dhcp4_parser.cc"
3565 break;
3566
3567 case 628: // $@91: %empty
3568#line 2258 "dhcp4_parser.yy"
3569 {
3570 ctx.unique("reservations", ctx.loc2pos(yystack_[0].location));
3571 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
3572 ctx.stack_.back()->set("reservations", l);
3573 ctx.stack_.push_back(l);
3574 ctx.enter(ctx.RESERVATIONS);
3575}
3576#line 3577 "dhcp4_parser.cc"
3577 break;
3578
3579 case 629: // reservations: "reservations" $@91 ":" "[" reservations_list "]"
3580#line 2264 "dhcp4_parser.yy"
3581 {
3582 ctx.stack_.pop_back();
3583 ctx.leave();
3584}
3585#line 3586 "dhcp4_parser.cc"
3586 break;
3587
3588 case 634: // not_empty_reservations_list: not_empty_reservations_list ","
3589#line 2275 "dhcp4_parser.yy"
3590 {
3591 ctx.warnAboutExtraCommas(yystack_[0].location);
3592 }
3593#line 3594 "dhcp4_parser.cc"
3594 break;
3595
3596 case 635: // $@92: %empty
3597#line 2280 "dhcp4_parser.yy"
3598 {
3599 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
3600 ctx.stack_.back()->add(m);
3601 ctx.stack_.push_back(m);
3602}
3603#line 3604 "dhcp4_parser.cc"
3604 break;
3605
3606 case 636: // reservation: "{" $@92 reservation_params "}"
3607#line 2284 "dhcp4_parser.yy"
3608 {
3610 ctx.stack_.pop_back();
3611}
3612#line 3613 "dhcp4_parser.cc"
3613 break;
3614
3615 case 637: // $@93: %empty
3616#line 2289 "dhcp4_parser.yy"
3617 {
3618 // Parse the reservations list entry map
3619 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
3620 ctx.stack_.push_back(m);
3621}
3622#line 3623 "dhcp4_parser.cc"
3623 break;
3624
3625 case 638: // sub_reservation: "{" $@93 reservation_params "}"
3626#line 2293 "dhcp4_parser.yy"
3627 {
3629 // parsing completed
3630}
3631#line 3632 "dhcp4_parser.cc"
3632 break;
3633
3634 case 643: // not_empty_reservation_params: not_empty_reservation_params ","
3635#line 2304 "dhcp4_parser.yy"
3636 {
3637 ctx.warnAboutExtraCommas(yystack_[0].location);
3638 }
3639#line 3640 "dhcp4_parser.cc"
3640 break;
3641
3642 case 659: // $@94: %empty
3643#line 2327 "dhcp4_parser.yy"
3644 {
3645 ctx.unique("next-server", ctx.loc2pos(yystack_[0].location));
3646 ctx.enter(ctx.NO_KEYWORD);
3647}
3648#line 3649 "dhcp4_parser.cc"
3649 break;
3650
3651 case 660: // next_server: "next-server" $@94 ":" "constant string"
3652#line 2330 "dhcp4_parser.yy"
3653 {
3654 ElementPtr next_server(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3655 ctx.stack_.back()->set("next-server", next_server);
3656 ctx.leave();
3657}
3658#line 3659 "dhcp4_parser.cc"
3659 break;
3660
3661 case 661: // $@95: %empty
3662#line 2336 "dhcp4_parser.yy"
3663 {
3664 ctx.unique("server-hostname", ctx.loc2pos(yystack_[0].location));
3665 ctx.enter(ctx.NO_KEYWORD);
3666}
3667#line 3668 "dhcp4_parser.cc"
3668 break;
3669
3670 case 662: // server_hostname: "server-hostname" $@95 ":" "constant string"
3671#line 2339 "dhcp4_parser.yy"
3672 {
3673 ElementPtr srv(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3674 ctx.stack_.back()->set("server-hostname", srv);
3675 ctx.leave();
3676}
3677#line 3678 "dhcp4_parser.cc"
3678 break;
3679
3680 case 663: // $@96: %empty
3681#line 2345 "dhcp4_parser.yy"
3682 {
3683 ctx.unique("boot-file-name", ctx.loc2pos(yystack_[0].location));
3684 ctx.enter(ctx.NO_KEYWORD);
3685}
3686#line 3687 "dhcp4_parser.cc"
3687 break;
3688
3689 case 664: // boot_file_name: "boot-file-name" $@96 ":" "constant string"
3690#line 2348 "dhcp4_parser.yy"
3691 {
3692 ElementPtr bootfile(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3693 ctx.stack_.back()->set("boot-file-name", bootfile);
3694 ctx.leave();
3695}
3696#line 3697 "dhcp4_parser.cc"
3697 break;
3698
3699 case 665: // $@97: %empty
3700#line 2354 "dhcp4_parser.yy"
3701 {
3702 ctx.unique("ip-address", ctx.loc2pos(yystack_[0].location));
3703 ctx.enter(ctx.NO_KEYWORD);
3704}
3705#line 3706 "dhcp4_parser.cc"
3706 break;
3707
3708 case 666: // ip_address: "ip-address" $@97 ":" "constant string"
3709#line 2357 "dhcp4_parser.yy"
3710 {
3711 ElementPtr addr(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3712 ctx.stack_.back()->set("ip-address", addr);
3713 ctx.leave();
3714}
3715#line 3716 "dhcp4_parser.cc"
3716 break;
3717
3718 case 667: // $@98: %empty
3719#line 2363 "dhcp4_parser.yy"
3720 {
3721 ctx.unique("duid", ctx.loc2pos(yystack_[0].location));
3722 ctx.enter(ctx.NO_KEYWORD);
3723}
3724#line 3725 "dhcp4_parser.cc"
3725 break;
3726
3727 case 668: // duid: "duid" $@98 ":" "constant string"
3728#line 2366 "dhcp4_parser.yy"
3729 {
3730 ElementPtr d(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3731 ctx.stack_.back()->set("duid", d);
3732 ctx.leave();
3733}
3734#line 3735 "dhcp4_parser.cc"
3735 break;
3736
3737 case 669: // $@99: %empty
3738#line 2372 "dhcp4_parser.yy"
3739 {
3740 ctx.unique("hw-address", ctx.loc2pos(yystack_[0].location));
3741 ctx.enter(ctx.NO_KEYWORD);
3742}
3743#line 3744 "dhcp4_parser.cc"
3744 break;
3745
3746 case 670: // hw_address: "hw-address" $@99 ":" "constant string"
3747#line 2375 "dhcp4_parser.yy"
3748 {
3749 ElementPtr hw(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3750 ctx.stack_.back()->set("hw-address", hw);
3751 ctx.leave();
3752}
3753#line 3754 "dhcp4_parser.cc"
3754 break;
3755
3756 case 671: // $@100: %empty
3757#line 2381 "dhcp4_parser.yy"
3758 {
3759 ctx.unique("client-id", ctx.loc2pos(yystack_[0].location));
3760 ctx.enter(ctx.NO_KEYWORD);
3761}
3762#line 3763 "dhcp4_parser.cc"
3763 break;
3764
3765 case 672: // client_id_value: "client-id" $@100 ":" "constant string"
3766#line 2384 "dhcp4_parser.yy"
3767 {
3768 ElementPtr hw(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3769 ctx.stack_.back()->set("client-id", hw);
3770 ctx.leave();
3771}
3772#line 3773 "dhcp4_parser.cc"
3773 break;
3774
3775 case 673: // $@101: %empty
3776#line 2390 "dhcp4_parser.yy"
3777 {
3778 ctx.unique("circuit-id", ctx.loc2pos(yystack_[0].location));
3779 ctx.enter(ctx.NO_KEYWORD);
3780}
3781#line 3782 "dhcp4_parser.cc"
3782 break;
3783
3784 case 674: // circuit_id_value: "circuit-id" $@101 ":" "constant string"
3785#line 2393 "dhcp4_parser.yy"
3786 {
3787 ElementPtr hw(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3788 ctx.stack_.back()->set("circuit-id", hw);
3789 ctx.leave();
3790}
3791#line 3792 "dhcp4_parser.cc"
3792 break;
3793
3794 case 675: // $@102: %empty
3795#line 2399 "dhcp4_parser.yy"
3796 {
3797 ctx.unique("flex-id", ctx.loc2pos(yystack_[0].location));
3798 ctx.enter(ctx.NO_KEYWORD);
3799}
3800#line 3801 "dhcp4_parser.cc"
3801 break;
3802
3803 case 676: // flex_id_value: "flex-id" $@102 ":" "constant string"
3804#line 2402 "dhcp4_parser.yy"
3805 {
3806 ElementPtr hw(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3807 ctx.stack_.back()->set("flex-id", hw);
3808 ctx.leave();
3809}
3810#line 3811 "dhcp4_parser.cc"
3811 break;
3812
3813 case 677: // $@103: %empty
3814#line 2408 "dhcp4_parser.yy"
3815 {
3816 ctx.unique("hostname", ctx.loc2pos(yystack_[0].location));
3817 ctx.enter(ctx.NO_KEYWORD);
3818}
3819#line 3820 "dhcp4_parser.cc"
3820 break;
3821
3822 case 678: // hostname: "hostname" $@103 ":" "constant string"
3823#line 2411 "dhcp4_parser.yy"
3824 {
3825 ElementPtr host(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3826 ctx.stack_.back()->set("hostname", host);
3827 ctx.leave();
3828}
3829#line 3830 "dhcp4_parser.cc"
3830 break;
3831
3832 case 679: // $@104: %empty
3833#line 2417 "dhcp4_parser.yy"
3834 {
3835 ctx.unique("client-classes", ctx.loc2pos(yystack_[0].location));
3836 ElementPtr c(new ListElement(ctx.loc2pos(yystack_[0].location)));
3837 ctx.stack_.back()->set("client-classes", c);
3838 ctx.stack_.push_back(c);
3839 ctx.enter(ctx.NO_KEYWORD);
3840}
3841#line 3842 "dhcp4_parser.cc"
3842 break;
3843
3844 case 680: // reservation_client_classes: "client-classes" $@104 ":" list_strings
3845#line 2423 "dhcp4_parser.yy"
3846 {
3847 ctx.stack_.pop_back();
3848 ctx.leave();
3849}
3850#line 3851 "dhcp4_parser.cc"
3851 break;
3852
3853 case 681: // $@105: %empty
3854#line 2431 "dhcp4_parser.yy"
3855 {
3856 ctx.unique("relay", ctx.loc2pos(yystack_[0].location));
3857 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
3858 ctx.stack_.back()->set("relay", m);
3859 ctx.stack_.push_back(m);
3860 ctx.enter(ctx.RELAY);
3861}
3862#line 3863 "dhcp4_parser.cc"
3863 break;
3864
3865 case 682: // relay: "relay" $@105 ":" "{" relay_map "}"
3866#line 2437 "dhcp4_parser.yy"
3867 {
3868 ctx.stack_.pop_back();
3869 ctx.leave();
3870}
3871#line 3872 "dhcp4_parser.cc"
3872 break;
3873
3874 case 684: // $@106: %empty
3875#line 2445 "dhcp4_parser.yy"
3876 {
3877 ctx.unique("ip-addresses", ctx.loc2pos(yystack_[0].location));
3878 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
3879 ctx.stack_.back()->set("ip-addresses", l);
3880 ctx.stack_.push_back(l);
3881 ctx.enter(ctx.NO_KEYWORD);
3882}
3883#line 3884 "dhcp4_parser.cc"
3884 break;
3885
3886 case 685: // ip_addresses: "ip-addresses" $@106 ":" list_strings
3887#line 2451 "dhcp4_parser.yy"
3888 {
3889 ctx.stack_.pop_back();
3890 ctx.leave();
3891}
3892#line 3893 "dhcp4_parser.cc"
3893 break;
3894
3895 case 686: // $@107: %empty
3896#line 2459 "dhcp4_parser.yy"
3897 {
3898 ctx.unique("client-classes", ctx.loc2pos(yystack_[0].location));
3899 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
3900 ctx.stack_.back()->set("client-classes", l);
3901 ctx.stack_.push_back(l);
3902 ctx.enter(ctx.CLIENT_CLASSES);
3903}
3904#line 3905 "dhcp4_parser.cc"
3905 break;
3906
3907 case 687: // client_classes: "client-classes" $@107 ":" "[" client_classes_list "]"
3908#line 2465 "dhcp4_parser.yy"
3909 {
3910 ctx.stack_.pop_back();
3911 ctx.leave();
3912}
3913#line 3914 "dhcp4_parser.cc"
3914 break;
3915
3916 case 690: // client_classes_list: client_classes_list ","
3917#line 2472 "dhcp4_parser.yy"
3918 {
3919 ctx.warnAboutExtraCommas(yystack_[0].location);
3920 }
3921#line 3922 "dhcp4_parser.cc"
3922 break;
3923
3924 case 691: // $@108: %empty
3925#line 2477 "dhcp4_parser.yy"
3926 {
3927 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
3928 ctx.stack_.back()->add(m);
3929 ctx.stack_.push_back(m);
3930}
3931#line 3932 "dhcp4_parser.cc"
3932 break;
3933
3934 case 692: // client_class_entry: "{" $@108 client_class_params "}"
3935#line 2481 "dhcp4_parser.yy"
3936 {
3937 // The name client class parameter is required.
3938 ctx.require("name", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
3939 ctx.stack_.pop_back();
3940}
3941#line 3942 "dhcp4_parser.cc"
3942 break;
3943
3944 case 697: // not_empty_client_class_params: not_empty_client_class_params ","
3945#line 2493 "dhcp4_parser.yy"
3946 {
3947 ctx.warnAboutExtraCommas(yystack_[0].location);
3948 }
3949#line 3950 "dhcp4_parser.cc"
3950 break;
3951
3952 case 716: // $@109: %empty
3953#line 2519 "dhcp4_parser.yy"
3954 {
3955 ctx.unique("test", ctx.loc2pos(yystack_[0].location));
3956 ctx.enter(ctx.NO_KEYWORD);
3957}
3958#line 3959 "dhcp4_parser.cc"
3959 break;
3960
3961 case 717: // client_class_test: "test" $@109 ":" "constant string"
3962#line 2522 "dhcp4_parser.yy"
3963 {
3964 ElementPtr test(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3965 ctx.stack_.back()->set("test", test);
3966 ctx.leave();
3967}
3968#line 3969 "dhcp4_parser.cc"
3969 break;
3970
3971 case 718: // $@110: %empty
3972#line 2528 "dhcp4_parser.yy"
3973 {
3974 ctx.unique("template-test", ctx.loc2pos(yystack_[0].location));
3975 ctx.enter(ctx.NO_KEYWORD);
3976}
3977#line 3978 "dhcp4_parser.cc"
3978 break;
3979
3980 case 719: // client_class_template_test: "template-test" $@110 ":" "constant string"
3981#line 2531 "dhcp4_parser.yy"
3982 {
3983 ElementPtr template_test(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
3984 ctx.stack_.back()->set("template-test", template_test);
3985 ctx.leave();
3986}
3987#line 3988 "dhcp4_parser.cc"
3988 break;
3989
3990 case 720: // only_if_required: "only-if-required" ":" "boolean"
3991#line 2538 "dhcp4_parser.yy"
3992 {
3993 ctx.unique("only-if-required", ctx.loc2pos(yystack_[2].location));
3994 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
3995 ctx.stack_.back()->set("only-if-required", b);
3996}
3997#line 3998 "dhcp4_parser.cc"
3998 break;
3999
4000 case 721: // only_in_additional_list: "only-in-additional-list" ":" "boolean"
4001#line 2544 "dhcp4_parser.yy"
4002 {
4003 ctx.unique("only-in-additional-list", ctx.loc2pos(yystack_[2].location));
4004 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
4005 ctx.stack_.back()->set("only-in-additional-list", b);
4006}
4007#line 4008 "dhcp4_parser.cc"
4008 break;
4009
4010 case 722: // dhcp4o6_port: "dhcp4o6-port" ":" "integer"
4011#line 2552 "dhcp4_parser.yy"
4012 {
4013 ctx.unique("dhcp4o6-port", ctx.loc2pos(yystack_[2].location));
4014 ElementPtr time(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
4015 ctx.stack_.back()->set("dhcp4o6-port", time);
4016}
4017#line 4018 "dhcp4_parser.cc"
4018 break;
4019
4020 case 723: // $@111: %empty
4021#line 2560 "dhcp4_parser.yy"
4022 {
4023 ctx.unique("control-socket", ctx.loc2pos(yystack_[0].location));
4024 ctx.unique("control-sockets", ctx.loc2pos(yystack_[0].location));
4025 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
4026 ctx.stack_.back()->set("control-socket", m);
4027 ctx.stack_.push_back(m);
4028 ctx.enter(ctx.CONTROL_SOCKET);
4029}
4030#line 4031 "dhcp4_parser.cc"
4031 break;
4032
4033 case 724: // control_socket: "control-socket" $@111 ":" "{" control_socket_params "}"
4034#line 2567 "dhcp4_parser.yy"
4035 {
4036 ctx.stack_.pop_back();
4037 ctx.leave();
4038}
4039#line 4040 "dhcp4_parser.cc"
4040 break;
4041
4042 case 725: // $@112: %empty
4043#line 2572 "dhcp4_parser.yy"
4044 {
4045 ctx.unique("control-sockets", ctx.loc2pos(yystack_[0].location));
4046 ctx.unique("control-socket", ctx.loc2pos(yystack_[0].location));
4047 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
4048 ctx.stack_.back()->set("control-sockets", l);
4049 ctx.stack_.push_back(l);
4050 ctx.enter(ctx.CONTROL_SOCKET);
4051}
4052#line 4053 "dhcp4_parser.cc"
4053 break;
4054
4055 case 726: // control_sockets: "control-sockets" $@112 ":" "[" control_socket_list "]"
4056#line 2579 "dhcp4_parser.yy"
4057 {
4058 ctx.stack_.pop_back();
4059 ctx.leave();
4060}
4061#line 4062 "dhcp4_parser.cc"
4062 break;
4063
4064 case 731: // not_empty_control_socket_list: not_empty_control_socket_list ","
4065#line 2590 "dhcp4_parser.yy"
4066 {
4067 ctx.warnAboutExtraCommas(yystack_[0].location);
4068 }
4069#line 4070 "dhcp4_parser.cc"
4070 break;
4071
4072 case 732: // $@113: %empty
4073#line 2595 "dhcp4_parser.yy"
4074 {
4075 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
4076 ctx.stack_.back()->add(m);
4077 ctx.stack_.push_back(m);
4078}
4079#line 4080 "dhcp4_parser.cc"
4080 break;
4081
4082 case 733: // control_socket_entry: "{" $@113 control_socket_params "}"
4083#line 2599 "dhcp4_parser.yy"
4084 {
4085 ctx.stack_.pop_back();
4086}
4087#line 4088 "dhcp4_parser.cc"
4088 break;
4089
4090 case 736: // control_socket_params: control_socket_params ","
4091#line 2605 "dhcp4_parser.yy"
4092 {
4093 ctx.warnAboutExtraCommas(yystack_[0].location);
4094 }
4095#line 4096 "dhcp4_parser.cc"
4096 break;
4097
4098 case 750: // $@114: %empty
4099#line 2625 "dhcp4_parser.yy"
4100 {
4101 ctx.unique("socket-type", ctx.loc2pos(yystack_[0].location));
4102 ctx.enter(ctx.CONTROL_SOCKET_TYPE);
4103}
4104#line 4105 "dhcp4_parser.cc"
4105 break;
4106
4107 case 751: // control_socket_type: "socket-type" $@114 ":" control_socket_type_value
4108#line 2628 "dhcp4_parser.yy"
4109 {
4110 ctx.stack_.back()->set("socket-type", yystack_[0].value.as < ElementPtr > ());
4111 ctx.leave();
4112}
4113#line 4114 "dhcp4_parser.cc"
4114 break;
4115
4116 case 752: // control_socket_type_value: "unix"
4117#line 2634 "dhcp4_parser.yy"
4118 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("unix", ctx.loc2pos(yystack_[0].location))); }
4119#line 4120 "dhcp4_parser.cc"
4120 break;
4121
4122 case 753: // control_socket_type_value: "http"
4123#line 2635 "dhcp4_parser.yy"
4124 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("http", ctx.loc2pos(yystack_[0].location))); }
4125#line 4126 "dhcp4_parser.cc"
4126 break;
4127
4128 case 754: // control_socket_type_value: "https"
4129#line 2636 "dhcp4_parser.yy"
4130 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("https", ctx.loc2pos(yystack_[0].location))); }
4131#line 4132 "dhcp4_parser.cc"
4132 break;
4133
4134 case 755: // $@115: %empty
4135#line 2639 "dhcp4_parser.yy"
4136 {
4137 ctx.unique("socket-name", ctx.loc2pos(yystack_[0].location));
4138 ctx.unique("socket-address", ctx.loc2pos(yystack_[0].location));
4139 ctx.enter(ctx.NO_KEYWORD);
4140}
4141#line 4142 "dhcp4_parser.cc"
4142 break;
4143
4144 case 756: // control_socket_name: "socket-name" $@115 ":" "constant string"
4145#line 2643 "dhcp4_parser.yy"
4146 {
4147 ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
4148 ctx.stack_.back()->set("socket-name", name);
4149 ctx.leave();
4150}
4151#line 4152 "dhcp4_parser.cc"
4152 break;
4153
4154 case 757: // $@116: %empty
4155#line 2649 "dhcp4_parser.yy"
4156 {
4157 ctx.unique("socket-address", ctx.loc2pos(yystack_[0].location));
4158 ctx.unique("socket-name", ctx.loc2pos(yystack_[0].location));
4159 ctx.enter(ctx.NO_KEYWORD);
4160}
4161#line 4162 "dhcp4_parser.cc"
4162 break;
4163
4164 case 758: // control_socket_address: "socket-address" $@116 ":" "constant string"
4165#line 2653 "dhcp4_parser.yy"
4166 {
4167 ElementPtr address(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
4168 ctx.stack_.back()->set("socket-address", address);
4169 ctx.leave();
4170}
4171#line 4172 "dhcp4_parser.cc"
4172 break;
4173
4174 case 759: // control_socket_port: "socket-port" ":" "integer"
4175#line 2659 "dhcp4_parser.yy"
4176 {
4177 ctx.unique("socket-port", ctx.loc2pos(yystack_[2].location));
4178 ElementPtr port(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
4179 ctx.stack_.back()->set("socket-port", port);
4180}
4181#line 4182 "dhcp4_parser.cc"
4182 break;
4183
4184 case 760: // cert_required: "cert-required" ":" "boolean"
4185#line 2665 "dhcp4_parser.yy"
4186 {
4187 ctx.unique("cert-required", ctx.loc2pos(yystack_[2].location));
4188 ElementPtr req(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
4189 ctx.stack_.back()->set("cert-required", req);
4190}
4191#line 4192 "dhcp4_parser.cc"
4192 break;
4193
4194 case 761: // $@117: %empty
4195#line 2671 "dhcp4_parser.yy"
4196 {
4197 ctx.unique("http-headers", ctx.loc2pos(yystack_[0].location));
4198 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
4199 ctx.stack_.back()->set("http-headers", l);
4200 ctx.stack_.push_back(l);
4201 ctx.enter(ctx.HTTP_HEADERS);
4202}
4203#line 4204 "dhcp4_parser.cc"
4204 break;
4205
4206 case 762: // http_headers: "http-headers" $@117 ":" "[" http_header_list "]"
4207#line 2677 "dhcp4_parser.yy"
4208 {
4209 ctx.stack_.pop_back();
4210 ctx.leave();
4211}
4212#line 4213 "dhcp4_parser.cc"
4213 break;
4214
4215 case 767: // not_empty_http_header_list: not_empty_http_header_list ","
4216#line 2688 "dhcp4_parser.yy"
4217 {
4218 ctx.warnAboutExtraCommas(yystack_[0].location);
4219 }
4220#line 4221 "dhcp4_parser.cc"
4221 break;
4222
4223 case 768: // $@118: %empty
4224#line 2693 "dhcp4_parser.yy"
4225 {
4226 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
4227 ctx.stack_.back()->add(m);
4228 ctx.stack_.push_back(m);
4229}
4230#line 4231 "dhcp4_parser.cc"
4231 break;
4232
4233 case 769: // http_header: "{" $@118 http_header_params "}"
4234#line 2697 "dhcp4_parser.yy"
4235 {
4236 ctx.stack_.pop_back();
4237}
4238#line 4239 "dhcp4_parser.cc"
4239 break;
4240
4241 case 772: // http_header_params: http_header_params ","
4242#line 2703 "dhcp4_parser.yy"
4243 {
4244 ctx.warnAboutExtraCommas(yystack_[0].location);
4245 }
4246#line 4247 "dhcp4_parser.cc"
4247 break;
4248
4249 case 778: // $@119: %empty
4250#line 2715 "dhcp4_parser.yy"
4251 {
4252 ctx.unique("value", ctx.loc2pos(yystack_[0].location));
4253 ctx.enter(ctx.NO_KEYWORD);
4254}
4255#line 4256 "dhcp4_parser.cc"
4256 break;
4257
4258 case 779: // header_value: "value" $@119 ":" "constant string"
4259#line 2718 "dhcp4_parser.yy"
4260 {
4261 ElementPtr value(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
4262 ctx.stack_.back()->set("value", value);
4263 ctx.leave();
4264}
4265#line 4266 "dhcp4_parser.cc"
4266 break;
4267
4268 case 780: // $@120: %empty
4269#line 2726 "dhcp4_parser.yy"
4270 {
4271 ctx.unique("authentication", ctx.loc2pos(yystack_[0].location));
4272 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
4273 ctx.stack_.back()->set("authentication", m);
4274 ctx.stack_.push_back(m);
4275 ctx.enter(ctx.AUTHENTICATION);
4276}
4277#line 4278 "dhcp4_parser.cc"
4278 break;
4279
4280 case 781: // authentication: "authentication" $@120 ":" "{" auth_params "}"
4281#line 2732 "dhcp4_parser.yy"
4282 {
4283 // The type parameter is required
4284 ctx.require("type", ctx.loc2pos(yystack_[2].location), ctx.loc2pos(yystack_[0].location));
4285 ctx.stack_.pop_back();
4286 ctx.leave();
4287}
4288#line 4289 "dhcp4_parser.cc"
4289 break;
4290
4291 case 784: // auth_params: auth_params ","
4292#line 2741 "dhcp4_parser.yy"
4293 {
4294 ctx.warnAboutExtraCommas(yystack_[0].location);
4295 }
4296#line 4297 "dhcp4_parser.cc"
4297 break;
4298
4299 case 792: // $@121: %empty
4300#line 2755 "dhcp4_parser.yy"
4301 {
4302 ctx.unique("type", ctx.loc2pos(yystack_[0].location));
4303 ctx.enter(ctx.AUTH_TYPE);
4304}
4305#line 4306 "dhcp4_parser.cc"
4306 break;
4307
4308 case 793: // auth_type: "type" $@121 ":" auth_type_value
4309#line 2758 "dhcp4_parser.yy"
4310 {
4311 ctx.stack_.back()->set("type", yystack_[0].value.as < ElementPtr > ());
4312 ctx.leave();
4313}
4314#line 4315 "dhcp4_parser.cc"
4315 break;
4316
4317 case 794: // auth_type_value: "basic"
4318#line 2763 "dhcp4_parser.yy"
4319 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("basic", ctx.loc2pos(yystack_[0].location))); }
4320#line 4321 "dhcp4_parser.cc"
4321 break;
4322
4323 case 795: // $@122: %empty
4324#line 2766 "dhcp4_parser.yy"
4325 {
4326 ctx.unique("realm", ctx.loc2pos(yystack_[0].location));
4327 ctx.enter(ctx.NO_KEYWORD);
4328}
4329#line 4330 "dhcp4_parser.cc"
4330 break;
4331
4332 case 796: // realm: "realm" $@122 ":" "constant string"
4333#line 2769 "dhcp4_parser.yy"
4334 {
4335 ElementPtr realm(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
4336 ctx.stack_.back()->set("realm", realm);
4337 ctx.leave();
4338}
4339#line 4340 "dhcp4_parser.cc"
4340 break;
4341
4342 case 797: // $@123: %empty
4343#line 2775 "dhcp4_parser.yy"
4344 {
4345 ctx.unique("directory", ctx.loc2pos(yystack_[0].location));
4346 ctx.enter(ctx.NO_KEYWORD);
4347}
4348#line 4349 "dhcp4_parser.cc"
4349 break;
4350
4351 case 798: // directory: "directory" $@123 ":" "constant string"
4352#line 2778 "dhcp4_parser.yy"
4353 {
4354 ElementPtr directory(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
4355 ctx.stack_.back()->set("directory", directory);
4356 ctx.leave();
4357}
4358#line 4359 "dhcp4_parser.cc"
4359 break;
4360
4361 case 799: // $@124: %empty
4362#line 2784 "dhcp4_parser.yy"
4363 {
4364 ctx.unique("clients", ctx.loc2pos(yystack_[0].location));
4365 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
4366 ctx.stack_.back()->set("clients", l);
4367 ctx.stack_.push_back(l);
4368 ctx.enter(ctx.CLIENTS);
4369}
4370#line 4371 "dhcp4_parser.cc"
4371 break;
4372
4373 case 800: // clients: "clients" $@124 ":" "[" clients_list "]"
4374#line 2790 "dhcp4_parser.yy"
4375 {
4376 ctx.stack_.pop_back();
4377 ctx.leave();
4378}
4379#line 4380 "dhcp4_parser.cc"
4380 break;
4381
4382 case 805: // not_empty_clients_list: not_empty_clients_list ","
4383#line 2801 "dhcp4_parser.yy"
4384 {
4385 ctx.warnAboutExtraCommas(yystack_[0].location);
4386 }
4387#line 4388 "dhcp4_parser.cc"
4388 break;
4389
4390 case 806: // $@125: %empty
4391#line 2806 "dhcp4_parser.yy"
4392 {
4393 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
4394 ctx.stack_.back()->add(m);
4395 ctx.stack_.push_back(m);
4396}
4397#line 4398 "dhcp4_parser.cc"
4398 break;
4399
4400 case 807: // basic_auth: "{" $@125 clients_params "}"
4401#line 2810 "dhcp4_parser.yy"
4402 {
4403 ctx.stack_.pop_back();
4404}
4405#line 4406 "dhcp4_parser.cc"
4406 break;
4407
4408 case 810: // clients_params: clients_params ","
4409#line 2816 "dhcp4_parser.yy"
4410 {
4411 ctx.warnAboutExtraCommas(yystack_[0].location);
4412 }
4413#line 4414 "dhcp4_parser.cc"
4414 break;
4415
4416 case 818: // $@126: %empty
4417#line 2830 "dhcp4_parser.yy"
4418 {
4419 ctx.unique("user-file", ctx.loc2pos(yystack_[0].location));
4420 ctx.enter(ctx.NO_KEYWORD);
4421}
4422#line 4423 "dhcp4_parser.cc"
4423 break;
4424
4425 case 819: // user_file: "user-file" $@126 ":" "constant string"
4426#line 2833 "dhcp4_parser.yy"
4427 {
4428 ElementPtr user(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
4429 ctx.stack_.back()->set("user-file", user);
4430 ctx.leave();
4431}
4432#line 4433 "dhcp4_parser.cc"
4433 break;
4434
4435 case 820: // $@127: %empty
4436#line 2839 "dhcp4_parser.yy"
4437 {
4438 ctx.unique("password-file", ctx.loc2pos(yystack_[0].location));
4439 ctx.enter(ctx.NO_KEYWORD);
4440}
4441#line 4442 "dhcp4_parser.cc"
4442 break;
4443
4444 case 821: // password_file: "password-file" $@127 ":" "constant string"
4445#line 2842 "dhcp4_parser.yy"
4446 {
4447 ElementPtr password(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
4448 ctx.stack_.back()->set("password-file", password);
4449 ctx.leave();
4450}
4451#line 4452 "dhcp4_parser.cc"
4452 break;
4453
4454 case 822: // $@128: %empty
4455#line 2850 "dhcp4_parser.yy"
4456 {
4457 ctx.unique("dhcp-queue-control", ctx.loc2pos(yystack_[0].location));
4458 ElementPtr qc(new MapElement(ctx.loc2pos(yystack_[0].location)));
4459 ctx.stack_.back()->set("dhcp-queue-control", qc);
4460 ctx.stack_.push_back(qc);
4461 ctx.enter(ctx.DHCP_QUEUE_CONTROL);
4462}
4463#line 4464 "dhcp4_parser.cc"
4464 break;
4465
4466 case 823: // dhcp_queue_control: "dhcp-queue-control" $@128 ":" "{" queue_control_params "}"
4467#line 2856 "dhcp4_parser.yy"
4468 {
4469 // The enable queue parameter is required.
4470 ctx.require("enable-queue", ctx.loc2pos(yystack_[2].location), ctx.loc2pos(yystack_[0].location));
4471 ctx.stack_.pop_back();
4472 ctx.leave();
4473}
4474#line 4475 "dhcp4_parser.cc"
4475 break;
4476
4477 case 826: // queue_control_params: queue_control_params ","
4478#line 2865 "dhcp4_parser.yy"
4479 {
4480 ctx.warnAboutExtraCommas(yystack_[0].location);
4481 }
4482#line 4483 "dhcp4_parser.cc"
4483 break;
4484
4485 case 833: // enable_queue: "enable-queue" ":" "boolean"
4486#line 2878 "dhcp4_parser.yy"
4487 {
4488 ctx.unique("enable-queue", ctx.loc2pos(yystack_[2].location));
4489 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
4490 ctx.stack_.back()->set("enable-queue", b);
4491}
4492#line 4493 "dhcp4_parser.cc"
4493 break;
4494
4495 case 834: // $@129: %empty
4496#line 2884 "dhcp4_parser.yy"
4497 {
4498 ctx.unique("queue-type", ctx.loc2pos(yystack_[0].location));
4499 ctx.enter(ctx.NO_KEYWORD);
4500}
4501#line 4502 "dhcp4_parser.cc"
4502 break;
4503
4504 case 835: // queue_type: "queue-type" $@129 ":" "constant string"
4505#line 2887 "dhcp4_parser.yy"
4506 {
4507 ElementPtr qt(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
4508 ctx.stack_.back()->set("queue-type", qt);
4509 ctx.leave();
4510}
4511#line 4512 "dhcp4_parser.cc"
4512 break;
4513
4514 case 836: // capacity: "capacity" ":" "integer"
4515#line 2893 "dhcp4_parser.yy"
4516 {
4517 ctx.unique("capacity", ctx.loc2pos(yystack_[2].location));
4518 ElementPtr c(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
4519 ctx.stack_.back()->set("capacity", c);
4520}
4521#line 4522 "dhcp4_parser.cc"
4522 break;
4523
4524 case 837: // $@130: %empty
4525#line 2899 "dhcp4_parser.yy"
4526 {
4527 ctx.unique(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location));
4528 ctx.enter(ctx.NO_KEYWORD);
4529}
4530#line 4531 "dhcp4_parser.cc"
4531 break;
4532
4533 case 838: // arbitrary_map_entry: "constant string" $@130 ":" value
4534#line 2902 "dhcp4_parser.yy"
4535 {
4536 ctx.stack_.back()->set(yystack_[3].value.as < std::string > (), yystack_[0].value.as < ElementPtr > ());
4537 ctx.leave();
4538}
4539#line 4540 "dhcp4_parser.cc"
4540 break;
4541
4542 case 839: // $@131: %empty
4543#line 2909 "dhcp4_parser.yy"
4544 {
4545 ctx.unique("dhcp-ddns", ctx.loc2pos(yystack_[0].location));
4546 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
4547 ctx.stack_.back()->set("dhcp-ddns", m);
4548 ctx.stack_.push_back(m);
4549 ctx.enter(ctx.DHCP_DDNS);
4550}
4551#line 4552 "dhcp4_parser.cc"
4552 break;
4553
4554 case 840: // dhcp_ddns: "dhcp-ddns" $@131 ":" "{" dhcp_ddns_params "}"
4555#line 2915 "dhcp4_parser.yy"
4556 {
4557 // The enable updates DHCP DDNS parameter is required.
4558 ctx.require("enable-updates", ctx.loc2pos(yystack_[2].location), ctx.loc2pos(yystack_[0].location));
4559 ctx.stack_.pop_back();
4560 ctx.leave();
4561}
4562#line 4563 "dhcp4_parser.cc"
4563 break;
4564
4565 case 841: // $@132: %empty
4566#line 2922 "dhcp4_parser.yy"
4567 {
4568 // Parse the dhcp-ddns map
4569 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
4570 ctx.stack_.push_back(m);
4571}
4572#line 4573 "dhcp4_parser.cc"
4573 break;
4574
4575 case 842: // sub_dhcp_ddns: "{" $@132 dhcp_ddns_params "}"
4576#line 2926 "dhcp4_parser.yy"
4577 {
4578 // The enable updates DHCP DDNS parameter is required.
4579 ctx.require("enable-updates", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
4580 // parsing completed
4581}
4582#line 4583 "dhcp4_parser.cc"
4583 break;
4584
4585 case 845: // dhcp_ddns_params: dhcp_ddns_params ","
4586#line 2934 "dhcp4_parser.yy"
4587 {
4588 ctx.warnAboutExtraCommas(yystack_[0].location);
4589 }
4590#line 4591 "dhcp4_parser.cc"
4591 break;
4592
4593 case 857: // enable_updates: "enable-updates" ":" "boolean"
4594#line 2952 "dhcp4_parser.yy"
4595 {
4596 ctx.unique("enable-updates", ctx.loc2pos(yystack_[2].location));
4597 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
4598 ctx.stack_.back()->set("enable-updates", b);
4599}
4600#line 4601 "dhcp4_parser.cc"
4601 break;
4602
4603 case 858: // $@133: %empty
4604#line 2958 "dhcp4_parser.yy"
4605 {
4606 ctx.unique("server-ip", ctx.loc2pos(yystack_[0].location));
4607 ctx.enter(ctx.NO_KEYWORD);
4608}
4609#line 4610 "dhcp4_parser.cc"
4610 break;
4611
4612 case 859: // server_ip: "server-ip" $@133 ":" "constant string"
4613#line 2961 "dhcp4_parser.yy"
4614 {
4615 ElementPtr s(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
4616 ctx.stack_.back()->set("server-ip", s);
4617 ctx.leave();
4618}
4619#line 4620 "dhcp4_parser.cc"
4620 break;
4621
4622 case 860: // server_port: "server-port" ":" "integer"
4623#line 2967 "dhcp4_parser.yy"
4624 {
4625 ctx.unique("server-port", ctx.loc2pos(yystack_[2].location));
4626 ElementPtr i(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
4627 ctx.stack_.back()->set("server-port", i);
4628}
4629#line 4630 "dhcp4_parser.cc"
4630 break;
4631
4632 case 861: // $@134: %empty
4633#line 2973 "dhcp4_parser.yy"
4634 {
4635 ctx.unique("sender-ip", ctx.loc2pos(yystack_[0].location));
4636 ctx.enter(ctx.NO_KEYWORD);
4637}
4638#line 4639 "dhcp4_parser.cc"
4639 break;
4640
4641 case 862: // sender_ip: "sender-ip" $@134 ":" "constant string"
4642#line 2976 "dhcp4_parser.yy"
4643 {
4644 ElementPtr s(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
4645 ctx.stack_.back()->set("sender-ip", s);
4646 ctx.leave();
4647}
4648#line 4649 "dhcp4_parser.cc"
4649 break;
4650
4651 case 863: // sender_port: "sender-port" ":" "integer"
4652#line 2982 "dhcp4_parser.yy"
4653 {
4654 ctx.unique("sender-port", ctx.loc2pos(yystack_[2].location));
4655 ElementPtr i(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
4656 ctx.stack_.back()->set("sender-port", i);
4657}
4658#line 4659 "dhcp4_parser.cc"
4659 break;
4660
4661 case 864: // max_queue_size: "max-queue-size" ":" "integer"
4662#line 2988 "dhcp4_parser.yy"
4663 {
4664 ctx.unique("max-queue-size", ctx.loc2pos(yystack_[2].location));
4665 ElementPtr i(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
4666 ctx.stack_.back()->set("max-queue-size", i);
4667}
4668#line 4669 "dhcp4_parser.cc"
4669 break;
4670
4671 case 865: // $@135: %empty
4672#line 2994 "dhcp4_parser.yy"
4673 {
4674 ctx.unique("ncr-protocol", ctx.loc2pos(yystack_[0].location));
4675 ctx.enter(ctx.NCR_PROTOCOL);
4676}
4677#line 4678 "dhcp4_parser.cc"
4678 break;
4679
4680 case 866: // ncr_protocol: "ncr-protocol" $@135 ":" ncr_protocol_value
4681#line 2997 "dhcp4_parser.yy"
4682 {
4683 ctx.stack_.back()->set("ncr-protocol", yystack_[0].value.as < ElementPtr > ());
4684 ctx.leave();
4685}
4686#line 4687 "dhcp4_parser.cc"
4687 break;
4688
4689 case 867: // ncr_protocol_value: "udp"
4690#line 3003 "dhcp4_parser.yy"
4691 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("UDP", ctx.loc2pos(yystack_[0].location))); }
4692#line 4693 "dhcp4_parser.cc"
4693 break;
4694
4695 case 868: // ncr_protocol_value: "tcp"
4696#line 3004 "dhcp4_parser.yy"
4697 { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("TCP", ctx.loc2pos(yystack_[0].location))); }
4698#line 4699 "dhcp4_parser.cc"
4699 break;
4700
4701 case 869: // $@136: %empty
4702#line 3007 "dhcp4_parser.yy"
4703 {
4704 ctx.unique("ncr-format", ctx.loc2pos(yystack_[0].location));
4705 ctx.enter(ctx.NCR_FORMAT);
4706}
4707#line 4708 "dhcp4_parser.cc"
4708 break;
4709
4710 case 870: // ncr_format: "ncr-format" $@136 ":" "JSON"
4711#line 3010 "dhcp4_parser.yy"
4712 {
4713 ElementPtr json(new StringElement("JSON", ctx.loc2pos(yystack_[0].location)));
4714 ctx.stack_.back()->set("ncr-format", json);
4715 ctx.leave();
4716}
4717#line 4718 "dhcp4_parser.cc"
4718 break;
4719
4720 case 871: // $@137: %empty
4721#line 3018 "dhcp4_parser.yy"
4722 {
4723 ctx.unique("config-control", ctx.loc2pos(yystack_[0].location));
4724 ElementPtr i(new MapElement(ctx.loc2pos(yystack_[0].location)));
4725 ctx.stack_.back()->set("config-control", i);
4726 ctx.stack_.push_back(i);
4727 ctx.enter(ctx.CONFIG_CONTROL);
4728}
4729#line 4730 "dhcp4_parser.cc"
4730 break;
4731
4732 case 872: // config_control: "config-control" $@137 ":" "{" config_control_params "}"
4733#line 3024 "dhcp4_parser.yy"
4734 {
4735 // No config control params are required
4736 ctx.stack_.pop_back();
4737 ctx.leave();
4738}
4739#line 4740 "dhcp4_parser.cc"
4740 break;
4741
4742 case 873: // $@138: %empty
4743#line 3030 "dhcp4_parser.yy"
4744 {
4745 // Parse the config-control map
4746 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
4747 ctx.stack_.push_back(m);
4748}
4749#line 4750 "dhcp4_parser.cc"
4750 break;
4751
4752 case 874: // sub_config_control: "{" $@138 config_control_params "}"
4753#line 3034 "dhcp4_parser.yy"
4754 {
4755 // No config_control params are required
4756 // parsing completed
4757}
4758#line 4759 "dhcp4_parser.cc"
4759 break;
4760
4761 case 877: // config_control_params: config_control_params ","
4762#line 3042 "dhcp4_parser.yy"
4763 {
4764 ctx.warnAboutExtraCommas(yystack_[0].location);
4765 }
4766#line 4767 "dhcp4_parser.cc"
4767 break;
4768
4769 case 880: // $@139: %empty
4770#line 3052 "dhcp4_parser.yy"
4771 {
4772 ctx.unique("config-databases", ctx.loc2pos(yystack_[0].location));
4773 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
4774 ctx.stack_.back()->set("config-databases", l);
4775 ctx.stack_.push_back(l);
4776 ctx.enter(ctx.CONFIG_DATABASE);
4777}
4778#line 4779 "dhcp4_parser.cc"
4779 break;
4780
4781 case 881: // config_databases: "config-databases" $@139 ":" "[" database_list "]"
4782#line 3058 "dhcp4_parser.yy"
4783 {
4784 ctx.stack_.pop_back();
4785 ctx.leave();
4786}
4787#line 4788 "dhcp4_parser.cc"
4788 break;
4789
4790 case 882: // config_fetch_wait_time: "config-fetch-wait-time" ":" "integer"
4791#line 3063 "dhcp4_parser.yy"
4792 {
4793 ctx.unique("config-fetch-wait-time", ctx.loc2pos(yystack_[2].location));
4794 ElementPtr value(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
4795 ctx.stack_.back()->set("config-fetch-wait-time", value);
4796}
4797#line 4798 "dhcp4_parser.cc"
4798 break;
4799
4800 case 883: // $@140: %empty
4801#line 3071 "dhcp4_parser.yy"
4802 {
4803 ctx.unique("loggers", ctx.loc2pos(yystack_[0].location));
4804 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
4805 ctx.stack_.back()->set("loggers", l);
4806 ctx.stack_.push_back(l);
4807 ctx.enter(ctx.LOGGERS);
4808}
4809#line 4810 "dhcp4_parser.cc"
4810 break;
4811
4812 case 884: // loggers: "loggers" $@140 ":" "[" loggers_entries "]"
4813#line 3077 "dhcp4_parser.yy"
4814 {
4815 ctx.stack_.pop_back();
4816 ctx.leave();
4817}
4818#line 4819 "dhcp4_parser.cc"
4819 break;
4820
4821 case 887: // loggers_entries: loggers_entries ","
4822#line 3086 "dhcp4_parser.yy"
4823 {
4824 ctx.warnAboutExtraCommas(yystack_[0].location);
4825 }
4826#line 4827 "dhcp4_parser.cc"
4827 break;
4828
4829 case 888: // $@141: %empty
4830#line 3092 "dhcp4_parser.yy"
4831 {
4832 ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location)));
4833 ctx.stack_.back()->add(l);
4834 ctx.stack_.push_back(l);
4835}
4836#line 4837 "dhcp4_parser.cc"
4837 break;
4838
4839 case 889: // logger_entry: "{" $@141 logger_params "}"
4840#line 3096 "dhcp4_parser.yy"
4841 {
4842 ctx.stack_.pop_back();
4843}
4844#line 4845 "dhcp4_parser.cc"
4845 break;
4846
4847 case 892: // logger_params: logger_params ","
4848#line 3102 "dhcp4_parser.yy"
4849 {
4850 ctx.warnAboutExtraCommas(yystack_[0].location);
4851 }
4852#line 4853 "dhcp4_parser.cc"
4853 break;
4854
4855 case 900: // debuglevel: "debuglevel" ":" "integer"
4856#line 3116 "dhcp4_parser.yy"
4857 {
4858 ctx.unique("debuglevel", ctx.loc2pos(yystack_[2].location));
4859 ElementPtr dl(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
4860 ctx.stack_.back()->set("debuglevel", dl);
4861}
4862#line 4863 "dhcp4_parser.cc"
4863 break;
4864
4865 case 901: // $@142: %empty
4866#line 3122 "dhcp4_parser.yy"
4867 {
4868 ctx.unique("severity", ctx.loc2pos(yystack_[0].location));
4869 ctx.enter(ctx.NO_KEYWORD);
4870}
4871#line 4872 "dhcp4_parser.cc"
4872 break;
4873
4874 case 902: // severity: "severity" $@142 ":" "constant string"
4875#line 3125 "dhcp4_parser.yy"
4876 {
4877 ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
4878 ctx.stack_.back()->set("severity", sev);
4879 ctx.leave();
4880}
4881#line 4882 "dhcp4_parser.cc"
4882 break;
4883
4884 case 903: // $@143: %empty
4885#line 3131 "dhcp4_parser.yy"
4886 {
4887 ctx.unique("output-options", ctx.loc2pos(yystack_[0].location));
4888 ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
4889 ctx.stack_.back()->set("output-options", l);
4890 ctx.stack_.push_back(l);
4891 ctx.enter(ctx.OUTPUT_OPTIONS);
4892}
4893#line 4894 "dhcp4_parser.cc"
4894 break;
4895
4896 case 904: // output_options_list: "output-options" $@143 ":" "[" output_options_list_content "]"
4897#line 3137 "dhcp4_parser.yy"
4898 {
4899 ctx.stack_.pop_back();
4900 ctx.leave();
4901}
4902#line 4903 "dhcp4_parser.cc"
4903 break;
4904
4905 case 907: // output_options_list_content: output_options_list_content ","
4906#line 3144 "dhcp4_parser.yy"
4907 {
4908 ctx.warnAboutExtraCommas(yystack_[0].location);
4909 }
4910#line 4911 "dhcp4_parser.cc"
4911 break;
4912
4913 case 908: // $@144: %empty
4914#line 3149 "dhcp4_parser.yy"
4915 {
4916 ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
4917 ctx.stack_.back()->add(m);
4918 ctx.stack_.push_back(m);
4919}
4920#line 4921 "dhcp4_parser.cc"
4921 break;
4922
4923 case 909: // output_entry: "{" $@144 output_params_list "}"
4924#line 3153 "dhcp4_parser.yy"
4925 {
4926 ctx.stack_.pop_back();
4927}
4928#line 4929 "dhcp4_parser.cc"
4929 break;
4930
4931 case 912: // output_params_list: output_params_list ","
4932#line 3159 "dhcp4_parser.yy"
4933 {
4934 ctx.warnAboutExtraCommas(yystack_[0].location);
4935 }
4936#line 4937 "dhcp4_parser.cc"
4937 break;
4938
4939 case 918: // $@145: %empty
4940#line 3171 "dhcp4_parser.yy"
4941 {
4942 ctx.unique("output", ctx.loc2pos(yystack_[0].location));
4943 ctx.enter(ctx.NO_KEYWORD);
4944}
4945#line 4946 "dhcp4_parser.cc"
4946 break;
4947
4948 case 919: // output: "output" $@145 ":" "constant string"
4949#line 3174 "dhcp4_parser.yy"
4950 {
4951 ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
4952 ctx.stack_.back()->set("output", sev);
4953 ctx.leave();
4954}
4955#line 4956 "dhcp4_parser.cc"
4956 break;
4957
4958 case 920: // flush: "flush" ":" "boolean"
4959#line 3180 "dhcp4_parser.yy"
4960 {
4961 ctx.unique("flush", ctx.loc2pos(yystack_[2].location));
4962 ElementPtr flush(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
4963 ctx.stack_.back()->set("flush", flush);
4964}
4965#line 4966 "dhcp4_parser.cc"
4966 break;
4967
4968 case 921: // maxsize: "maxsize" ":" "integer"
4969#line 3186 "dhcp4_parser.yy"
4970 {
4971 ctx.unique("maxsize", ctx.loc2pos(yystack_[2].location));
4972 ElementPtr maxsize(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
4973 ctx.stack_.back()->set("maxsize", maxsize);
4974}
4975#line 4976 "dhcp4_parser.cc"
4976 break;
4977
4978 case 922: // maxver: "maxver" ":" "integer"
4979#line 3192 "dhcp4_parser.yy"
4980 {
4981 ctx.unique("maxver", ctx.loc2pos(yystack_[2].location));
4982 ElementPtr maxver(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location)));
4983 ctx.stack_.back()->set("maxver", maxver);
4984}
4985#line 4986 "dhcp4_parser.cc"
4986 break;
4987
4988 case 923: // $@146: %empty
4989#line 3198 "dhcp4_parser.yy"
4990 {
4991 ctx.unique("pattern", ctx.loc2pos(yystack_[0].location));
4992 ctx.enter(ctx.NO_KEYWORD);
4993}
4994#line 4995 "dhcp4_parser.cc"
4995 break;
4996
4997 case 924: // pattern: "pattern" $@146 ":" "constant string"
4998#line 3201 "dhcp4_parser.yy"
4999 {
5000 ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location)));
5001 ctx.stack_.back()->set("pattern", sev);
5002 ctx.leave();
5003}
5004#line 5005 "dhcp4_parser.cc"
5005 break;
5006
5007 case 925: // $@147: %empty
5008#line 3207 "dhcp4_parser.yy"
5009 {
5010 ctx.unique("compatibility", ctx.loc2pos(yystack_[0].location));
5011 ElementPtr i(new MapElement(ctx.loc2pos(yystack_[0].location)));
5012 ctx.stack_.back()->set("compatibility", i);
5013 ctx.stack_.push_back(i);
5014 ctx.enter(ctx.COMPATIBILITY);
5015}
5016#line 5017 "dhcp4_parser.cc"
5017 break;
5018
5019 case 926: // compatibility: "compatibility" $@147 ":" "{" compatibility_params "}"
5020#line 3213 "dhcp4_parser.yy"
5021 {
5022 ctx.stack_.pop_back();
5023 ctx.leave();
5024}
5025#line 5026 "dhcp4_parser.cc"
5026 break;
5027
5028 case 929: // compatibility_params: compatibility_params ","
5029#line 3220 "dhcp4_parser.yy"
5030 {
5031 ctx.warnAboutExtraCommas(yystack_[0].location);
5032 }
5033#line 5034 "dhcp4_parser.cc"
5034 break;
5035
5036 case 935: // lenient_option_parsing: "lenient-option-parsing" ":" "boolean"
5037#line 3232 "dhcp4_parser.yy"
5038 {
5039 ctx.unique("lenient-option-parsing", ctx.loc2pos(yystack_[2].location));
5040 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
5041 ctx.stack_.back()->set("lenient-option-parsing", b);
5042}
5043#line 5044 "dhcp4_parser.cc"
5044 break;
5045
5046 case 936: // ignore_dhcp_server_identifier: "ignore-dhcp-server-identifier" ":" "boolean"
5047#line 3238 "dhcp4_parser.yy"
5048 {
5049 ctx.unique("ignore-dhcp-server-identifier", ctx.loc2pos(yystack_[2].location));
5050 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
5051 ctx.stack_.back()->set("ignore-dhcp-server-identifier", b);
5052}
5053#line 5054 "dhcp4_parser.cc"
5054 break;
5055
5056 case 937: // ignore_rai_link_selection: "ignore-rai-link-selection" ":" "boolean"
5057#line 3244 "dhcp4_parser.yy"
5058 {
5059 ctx.unique("ignore-rai-link-selection", ctx.loc2pos(yystack_[2].location));
5060 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
5061 ctx.stack_.back()->set("ignore-rai-link-selection", b);
5062}
5063#line 5064 "dhcp4_parser.cc"
5064 break;
5065
5066 case 938: // exclude_first_last_24: "exclude-first-last-24" ":" "boolean"
5067#line 3250 "dhcp4_parser.yy"
5068 {
5069 ctx.unique("exclude-first-last-24", ctx.loc2pos(yystack_[2].location));
5070 ElementPtr b(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
5071 ctx.stack_.back()->set("exclude-first-last-24", b);
5072}
5073#line 5074 "dhcp4_parser.cc"
5074 break;
5075
5076
5077#line 5078 "dhcp4_parser.cc"
5078
5079 default:
5080 break;
5081 }
5082 }
5083#if YY_EXCEPTIONS
5084 catch (const syntax_error& yyexc)
5085 {
5086 YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
5087 error (yyexc);
5088 YYERROR;
5089 }
5090#endif // YY_EXCEPTIONS
5091 YY_SYMBOL_PRINT ("-> $$ =", yylhs);
5092 yypop_ (yylen);
5093 yylen = 0;
5094
5095 // Shift the result of the reduction.
5096 yypush_ (YY_NULLPTR, YY_MOVE (yylhs));
5097 }
5098 goto yynewstate;
5099
5100
5101 /*--------------------------------------.
5102 | yyerrlab -- here on detecting error. |
5103 `--------------------------------------*/
5104 yyerrlab:
5105 // If not already recovering from an error, report this error.
5106 if (!yyerrstatus_)
5107 {
5108 ++yynerrs_;
5109 context yyctx (*this, yyla);
5110 std::string msg = yysyntax_error_ (yyctx);
5111 error (yyla.location, YY_MOVE (msg));
5112 }
5113
5114
5115 yyerror_range[1].location = yyla.location;
5116 if (yyerrstatus_ == 3)
5117 {
5118 /* If just tried and failed to reuse lookahead token after an
5119 error, discard it. */
5120
5121 // Return failure if at end of input.
5122 if (yyla.kind () == symbol_kind::S_YYEOF)
5123 YYABORT;
5124 else if (!yyla.empty ())
5125 {
5126 yy_destroy_ ("Error: discarding", yyla);
5127 yyla.clear ();
5128 }
5129 }
5130
5131 // Else will try to reuse lookahead token after shifting the error token.
5132 goto yyerrlab1;
5133
5134
5135 /*---------------------------------------------------.
5136 | yyerrorlab -- error raised explicitly by YYERROR. |
5137 `---------------------------------------------------*/
5138 yyerrorlab:
5139 /* Pacify compilers when the user code never invokes YYERROR and
5140 the label yyerrorlab therefore never appears in user code. */
5141 if (false)
5142 YYERROR;
5143
5144 /* Do not reclaim the symbols of the rule whose action triggered
5145 this YYERROR. */
5146 yypop_ (yylen);
5147 yylen = 0;
5148 YY_STACK_PRINT ();
5149 goto yyerrlab1;
5150
5151
5152 /*-------------------------------------------------------------.
5153 | yyerrlab1 -- common code for both syntax error and YYERROR. |
5154 `-------------------------------------------------------------*/
5155 yyerrlab1:
5156 yyerrstatus_ = 3; // Each real token shifted decrements this.
5157 // Pop stack until we find a state that shifts the error token.
5158 for (;;)
5159 {
5160 yyn = yypact_[+yystack_[0].state];
5161 if (!yy_pact_value_is_default_ (yyn))
5162 {
5164 if (0 <= yyn && yyn <= yylast_
5165 && yycheck_[yyn] == symbol_kind::S_YYerror)
5166 {
5167 yyn = yytable_[yyn];
5168 if (0 < yyn)
5169 break;
5170 }
5171 }
5172
5173 // Pop the current state because it cannot handle the error token.
5174 if (yystack_.size () == 1)
5175 YYABORT;
5176
5177 yyerror_range[1].location = yystack_[0].location;
5178 yy_destroy_ ("Error: popping", yystack_[0]);
5179 yypop_ ();
5180 YY_STACK_PRINT ();
5181 }
5182 {
5183 stack_symbol_type error_token;
5184
5185 yyerror_range[2].location = yyla.location;
5186 YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);
5187
5188 // Shift the error token.
5189 error_token.state = state_type (yyn);
5190 yypush_ ("Shifting",