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