dhcp4_parser.cc 152 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
// A Bison parser, made by GNU Bison 3.0.4.

// Skeleton implementation for Bison LALR(1) parsers in C++

// Copyright (C) 2002-2015 Free Software Foundation, Inc.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

// As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work
// under terms of your choice, so long as that work isn't itself a
// parser generator using the skeleton or a modified version thereof
// as a parser skeleton.  Alternatively, if you modify or redistribute
// the parser skeleton itself, you may (at your option) remove this
// special exception, which will cause the skeleton and the resulting
// Bison output files to be licensed under the GNU General Public
// License without this special exception.

// This special exception was added by the Free Software Foundation in
// version 2.2 of Bison.

// Take the name prefix into account.
#define yylex   parser4_lex

// First part of user declarations.

#line 39 "dhcp4_parser.cc" // lalr1.cc:404

# ifndef YY_NULLPTR
#  if defined __cplusplus && 201103L <= __cplusplus
#   define YY_NULLPTR nullptr
#  else
#   define YY_NULLPTR 0
#  endif
# endif

#include "dhcp4_parser.h"

// User implementation prologue.

#line 53 "dhcp4_parser.cc" // lalr1.cc:412
// Unqualified %code blocks.
#line 34 "dhcp4_parser.yy" // lalr1.cc:413

#include <dhcp4/parser_context.h>

#line 59 "dhcp4_parser.cc" // lalr1.cc:413


#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
#  endif
# endif
# ifndef YY_
#  define YY_(msgid) msgid
# endif
#endif

#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
   If N is 0, then set CURRENT to the empty location which ends
   the previous symbol: RHS[0] (always defined).  */

# ifndef YYLLOC_DEFAULT
#  define YYLLOC_DEFAULT(Current, Rhs, N)                               \
    do                                                                  \
      if (N)                                                            \
        {                                                               \
          (Current).begin  = YYRHSLOC (Rhs, 1).begin;                   \
          (Current).end    = YYRHSLOC (Rhs, N).end;                     \
        }                                                               \
      else                                                              \
        {                                                               \
          (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;      \
        }                                                               \
    while (/*CONSTCOND*/ false)
# endif


// Suppress unused-variable warnings by "using" E.
#define YYUSE(E) ((void) (E))

// Enable debugging if requested.
#if PARSER4_DEBUG

// A pseudo ostream that takes yydebug_ into account.
# define YYCDEBUG if (yydebug_) (*yycdebug_)

# define YY_SYMBOL_PRINT(Title, Symbol)         \
  do {                                          \
    if (yydebug_)                               \
    {                                           \
      *yycdebug_ << Title << ' ';               \
      yy_print_ (*yycdebug_, Symbol);           \
      *yycdebug_ << std::endl;                  \
    }                                           \
  } while (false)

# define YY_REDUCE_PRINT(Rule)          \
  do {                                  \
    if (yydebug_)                       \
      yy_reduce_print_ (Rule);          \
  } while (false)

# define YY_STACK_PRINT()               \
  do {                                  \
    if (yydebug_)                       \
      yystack_print_ ();                \
  } while (false)

#else // !PARSER4_DEBUG

# define YYCDEBUG if (false) std::cerr
# define YY_SYMBOL_PRINT(Title, Symbol)  YYUSE(Symbol)
# define YY_REDUCE_PRINT(Rule)           static_cast<void>(0)
# define YY_STACK_PRINT()                static_cast<void>(0)

#endif // !PARSER4_DEBUG

#define yyerrok         (yyerrstatus_ = 0)
#define yyclearin       (yyla.clear ())

#define YYACCEPT        goto yyacceptlab
#define YYABORT         goto yyabortlab
#define YYERROR         goto yyerrorlab
#define YYRECOVERING()  (!!yyerrstatus_)

#line 14 "dhcp4_parser.yy" // lalr1.cc:479
namespace isc { namespace dhcp {
#line 145 "dhcp4_parser.cc" // lalr1.cc:479

  /* Return YYSTR after stripping away unnecessary quotes and
     backslashes, so that it's suitable for yyerror.  The heuristic is
     that double-quoting is unnecessary unless the string contains an
     apostrophe, a comma, or backslash (other than backslash-backslash).
     YYSTR is taken from yytname.  */
  std::string
  Dhcp4Parser::yytnamerr_ (const char *yystr)
  {
    if (*yystr == '"')
      {
        std::string yyr = "";
        char const *yyp = yystr;

        for (;;)
          switch (*++yyp)
            {
            case '\'':
            case ',':
              goto do_not_strip_quotes;

            case '\\':
              if (*++yyp != '\\')
                goto do_not_strip_quotes;
              // Fall through.
            default:
              yyr += *yyp;
              break;

            case '"':
              return yyr;
            }
      do_not_strip_quotes: ;
      }

    return yystr;
  }


  /// Build a parser object.
  Dhcp4Parser::Dhcp4Parser (isc::dhcp::Parser4Context& ctx_yyarg)
    :
#if PARSER4_DEBUG
      yydebug_ (false),
      yycdebug_ (&std::cerr),
#endif
      ctx (ctx_yyarg)
  {}

  Dhcp4Parser::~Dhcp4Parser ()
  {}


  /*---------------.
  | Symbol types.  |
  `---------------*/



  // by_state.
  inline
  Dhcp4Parser::by_state::by_state ()
    : state (empty_state)
  {}

  inline
  Dhcp4Parser::by_state::by_state (const by_state& other)
    : state (other.state)
  {}

  inline
  void
  Dhcp4Parser::by_state::clear ()
  {
    state = empty_state;
  }

  inline
  void
  Dhcp4Parser::by_state::move (by_state& that)
  {
    state = that.state;
    that.clear ();
  }

  inline
  Dhcp4Parser::by_state::by_state (state_type s)
    : state (s)
  {}

  inline
  Dhcp4Parser::symbol_number_type
  Dhcp4Parser::by_state::type_get () const
  {
    if (state == empty_state)
      return empty_symbol;
    else
      return yystos_[state];
  }

  inline
  Dhcp4Parser::stack_symbol_type::stack_symbol_type ()
  {}


  inline
  Dhcp4Parser::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that)
    : super_type (s, that.location)
  {
      switch (that.type_get ())
    {
Francis Dupont's avatar
Francis Dupont committed
256
257
258
259
260
261
262
263
      case 165: // value
      case 169: // map_value
      case 207: // socket_type
      case 210: // outbound_interface_value
      case 220: // db_type
      case 297: // hr_mode
      case 442: // ncr_protocol_value
      case 450: // replace_client_name_value
264
265
266
        value.move< ElementPtr > (that.value);
        break;

Francis Dupont's avatar
Francis Dupont committed
267
      case 150: // "boolean"
268
269
270
        value.move< bool > (that.value);
        break;

Francis Dupont's avatar
Francis Dupont committed
271
      case 149: // "floating point"
272
273
274
        value.move< double > (that.value);
        break;

Francis Dupont's avatar
Francis Dupont committed
275
      case 148: // "integer"
276
277
278
        value.move< int64_t > (that.value);
        break;

Francis Dupont's avatar
Francis Dupont committed
279
      case 147: // "constant string"
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
        value.move< std::string > (that.value);
        break;

      default:
        break;
    }

    // that is emptied.
    that.type = empty_symbol;
  }

  inline
  Dhcp4Parser::stack_symbol_type&
  Dhcp4Parser::stack_symbol_type::operator= (const stack_symbol_type& that)
  {
    state = that.state;
      switch (that.type_get ())
    {
Francis Dupont's avatar
Francis Dupont committed
298
299
300
301
302
303
304
305
      case 165: // value
      case 169: // map_value
      case 207: // socket_type
      case 210: // outbound_interface_value
      case 220: // db_type
      case 297: // hr_mode
      case 442: // ncr_protocol_value
      case 450: // replace_client_name_value
306
307
308
        value.copy< ElementPtr > (that.value);
        break;

Francis Dupont's avatar
Francis Dupont committed
309
      case 150: // "boolean"
310
311
312
        value.copy< bool > (that.value);
        break;

Francis Dupont's avatar
Francis Dupont committed
313
      case 149: // "floating point"
314
315
316
        value.copy< double > (that.value);
        break;

Francis Dupont's avatar
Francis Dupont committed
317
      case 148: // "integer"
318
319
320
        value.copy< int64_t > (that.value);
        break;

Francis Dupont's avatar
Francis Dupont committed
321
      case 147: // "constant string"
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
        value.copy< std::string > (that.value);
        break;

      default:
        break;
    }

    location = that.location;
    return *this;
  }


  template <typename Base>
  inline
  void
  Dhcp4Parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
  {
    if (yymsg)
      YY_SYMBOL_PRINT (yymsg, yysym);
  }

#if PARSER4_DEBUG
  template <typename Base>
  void
  Dhcp4Parser::yy_print_ (std::ostream& yyo,
                                     const basic_symbol<Base>& yysym) const
  {
    std::ostream& yyoutput = yyo;
    YYUSE (yyoutput);
    symbol_number_type yytype = yysym.type_get ();
    // Avoid a (spurious) G++ 4.8 warning about "array subscript is
    // below array bounds".
    if (yysym.empty ())
      std::abort ();
    yyo << (yytype < yyntokens_ ? "token" : "nterm")
        << ' ' << yytname_[yytype] << " ("
        << yysym.location << ": ";
    switch (yytype)
    {
Francis Dupont's avatar
Francis Dupont committed
361
            case 147: // "constant string"
362

Francis Dupont's avatar
Francis Dupont committed
363
#line 225 "dhcp4_parser.yy" // lalr1.cc:636
364
        { yyoutput << yysym.value.template as< std::string > (); }
365
#line 366 "dhcp4_parser.cc" // lalr1.cc:636
366
367
        break;

Francis Dupont's avatar
Francis Dupont committed
368
      case 148: // "integer"
369

Francis Dupont's avatar
Francis Dupont committed
370
#line 225 "dhcp4_parser.yy" // lalr1.cc:636
371
        { yyoutput << yysym.value.template as< int64_t > (); }
372
#line 373 "dhcp4_parser.cc" // lalr1.cc:636
373
374
        break;

Francis Dupont's avatar
Francis Dupont committed
375
      case 149: // "floating point"
376

Francis Dupont's avatar
Francis Dupont committed
377
#line 225 "dhcp4_parser.yy" // lalr1.cc:636
378
        { yyoutput << yysym.value.template as< double > (); }
379
#line 380 "dhcp4_parser.cc" // lalr1.cc:636
380
381
        break;

Francis Dupont's avatar
Francis Dupont committed
382
      case 150: // "boolean"
383

Francis Dupont's avatar
Francis Dupont committed
384
#line 225 "dhcp4_parser.yy" // lalr1.cc:636
385
        { yyoutput << yysym.value.template as< bool > (); }
386
#line 387 "dhcp4_parser.cc" // lalr1.cc:636
387
388
        break;

Francis Dupont's avatar
Francis Dupont committed
389
      case 165: // value
390

Francis Dupont's avatar
Francis Dupont committed
391
#line 225 "dhcp4_parser.yy" // lalr1.cc:636
392
        { yyoutput << yysym.value.template as< ElementPtr > (); }
393
#line 394 "dhcp4_parser.cc" // lalr1.cc:636
394
395
        break;

Francis Dupont's avatar
Francis Dupont committed
396
      case 169: // map_value
397

Francis Dupont's avatar
Francis Dupont committed
398
#line 225 "dhcp4_parser.yy" // lalr1.cc:636
399
        { yyoutput << yysym.value.template as< ElementPtr > (); }
400
#line 401 "dhcp4_parser.cc" // lalr1.cc:636
401
402
        break;

Francis Dupont's avatar
Francis Dupont committed
403
      case 207: // socket_type
404

Francis Dupont's avatar
Francis Dupont committed
405
#line 225 "dhcp4_parser.yy" // lalr1.cc:636
406
        { yyoutput << yysym.value.template as< ElementPtr > (); }
407
#line 408 "dhcp4_parser.cc" // lalr1.cc:636
408
409
        break;

Francis Dupont's avatar
Francis Dupont committed
410
      case 210: // outbound_interface_value
411

Francis Dupont's avatar
Francis Dupont committed
412
#line 225 "dhcp4_parser.yy" // lalr1.cc:636
413
        { yyoutput << yysym.value.template as< ElementPtr > (); }
414
#line 415 "dhcp4_parser.cc" // lalr1.cc:636
415
416
        break;

Francis Dupont's avatar
Francis Dupont committed
417
      case 220: // db_type
418

Francis Dupont's avatar
Francis Dupont committed
419
#line 225 "dhcp4_parser.yy" // lalr1.cc:636
420
        { yyoutput << yysym.value.template as< ElementPtr > (); }
421
#line 422 "dhcp4_parser.cc" // lalr1.cc:636
422
423
        break;

Francis Dupont's avatar
Francis Dupont committed
424
      case 297: // hr_mode
425

Francis Dupont's avatar
Francis Dupont committed
426
#line 225 "dhcp4_parser.yy" // lalr1.cc:636
427
        { yyoutput << yysym.value.template as< ElementPtr > (); }
428
#line 429 "dhcp4_parser.cc" // lalr1.cc:636
429
430
        break;

Francis Dupont's avatar
Francis Dupont committed
431
      case 442: // ncr_protocol_value
432

Francis Dupont's avatar
Francis Dupont committed
433
#line 225 "dhcp4_parser.yy" // lalr1.cc:636
434
        { yyoutput << yysym.value.template as< ElementPtr > (); }
435
436
437
#line 436 "dhcp4_parser.cc" // lalr1.cc:636
        break;

Francis Dupont's avatar
Francis Dupont committed
438
      case 450: // replace_client_name_value
439

Francis Dupont's avatar
Francis Dupont committed
440
#line 225 "dhcp4_parser.yy" // lalr1.cc:636
441
442
        { yyoutput << yysym.value.template as< ElementPtr > (); }
#line 443 "dhcp4_parser.cc" // lalr1.cc:636
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
        break;


      default:
        break;
    }
    yyo << ')';
  }
#endif

  inline
  void
  Dhcp4Parser::yypush_ (const char* m, state_type s, symbol_type& sym)
  {
    stack_symbol_type t (s, sym);
    yypush_ (m, t);
  }

  inline
  void
  Dhcp4Parser::yypush_ (const char* m, stack_symbol_type& s)
  {
    if (m)
      YY_SYMBOL_PRINT (m, s);
    yystack_.push (s);
  }

  inline
  void
  Dhcp4Parser::yypop_ (unsigned int n)
  {
    yystack_.pop (n);
  }

#if PARSER4_DEBUG
  std::ostream&
  Dhcp4Parser::debug_stream () const
  {
    return *yycdebug_;
  }

  void
  Dhcp4Parser::set_debug_stream (std::ostream& o)
  {
    yycdebug_ = &o;
  }


  Dhcp4Parser::debug_level_type
  Dhcp4Parser::debug_level () const
  {
    return yydebug_;
  }

  void
  Dhcp4Parser::set_debug_level (debug_level_type l)
  {
    yydebug_ = l;
  }
#endif // PARSER4_DEBUG

  inline Dhcp4Parser::state_type
  Dhcp4Parser::yy_lr_goto_state_ (state_type yystate, int yysym)
  {
    int yyr = yypgoto_[yysym - yyntokens_] + yystate;
    if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
      return yytable_[yyr];
    else
      return yydefgoto_[yysym - yyntokens_];
  }

  inline bool
  Dhcp4Parser::yy_pact_value_is_default_ (int yyvalue)
  {
    return yyvalue == yypact_ninf_;
  }

  inline bool
  Dhcp4Parser::yy_table_value_is_error_ (int yyvalue)
  {
    return yyvalue == yytable_ninf_;
  }

  int
  Dhcp4Parser::parse ()
  {
    // State.
    int yyn;
    /// Length of the RHS of the rule being reduced.
    int yylen = 0;

    // Error handling.
    int yynerrs_ = 0;
    int yyerrstatus_ = 0;

    /// The lookahead symbol.
    symbol_type yyla;

    /// The locations where the error started and ended.
    stack_symbol_type yyerror_range[3];

    /// The return value of parse ().
    int yyresult;

    // FIXME: This shoud be completely indented.  It is not yet to
    // avoid gratuitous conflicts when merging into the master branch.
    try
      {
    YYCDEBUG << "Starting parse" << std::endl;


    /* Initialize the stack.  The initial state will be set in
       yynewstate, since the latter expects the semantical and the
       location values to have been already stored, initialize these
       stacks with a primary value.  */
    yystack_.clear ();
    yypush_ (YY_NULLPTR, 0, yyla);

    // A new symbol was pushed on the stack.
  yynewstate:
    YYCDEBUG << "Entering state " << yystack_[0].state << std::endl;

    // Accept?
    if (yystack_[0].state == yyfinal_)
      goto yyacceptlab;

    goto yybackup;

    // Backup.
  yybackup:

    // Try to take a decision without lookahead.
    yyn = yypact_[yystack_[0].state];
    if (yy_pact_value_is_default_ (yyn))
      goto yydefault;

    // Read a lookahead token.
    if (yyla.empty ())
      {
        YYCDEBUG << "Reading a token: ";
        try
          {
            symbol_type yylookahead (yylex (ctx));
            yyla.move (yylookahead);
          }
        catch (const syntax_error& yyexc)
          {
            error (yyexc);
            goto yyerrlab1;
          }
      }
    YY_SYMBOL_PRINT ("Next token is", yyla);

    /* If the proper action on seeing token YYLA.TYPE is to reduce or
       to detect an error, take that action.  */
    yyn += yyla.type_get ();
    if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ())
      goto yydefault;

    // Reduce or error.
    yyn = yytable_[yyn];
    if (yyn <= 0)
      {
        if (yy_table_value_is_error_ (yyn))
          goto yyerrlab;
        yyn = -yyn;
        goto yyreduce;
      }

    // Count tokens shifted since error; after three, turn off error status.
    if (yyerrstatus_)
      --yyerrstatus_;

    // Shift the lookahead token.
    yypush_ ("Shifting", yyn, yyla);
    goto yynewstate;

  /*-----------------------------------------------------------.
  | yydefault -- do the default action for the current state.  |
  `-----------------------------------------------------------*/
  yydefault:
    yyn = yydefact_[yystack_[0].state];
    if (yyn == 0)
      goto yyerrlab;
    goto yyreduce;

  /*-----------------------------.
  | yyreduce -- Do a reduction.  |
  `-----------------------------*/
  yyreduce:
    yylen = yyr2_[yyn];
    {
      stack_symbol_type yylhs;
      yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);
      /* Variants are always initialized to an empty instance of the
         correct type. The default '$$ = $1' action is NOT applied
         when using variants.  */
        switch (yyr1_[yyn])
    {
Francis Dupont's avatar
Francis Dupont committed
642
643
644
645
646
647
648
649
      case 165: // value
      case 169: // map_value
      case 207: // socket_type
      case 210: // outbound_interface_value
      case 220: // db_type
      case 297: // hr_mode
      case 442: // ncr_protocol_value
      case 450: // replace_client_name_value
650
651
652
        yylhs.value.build< ElementPtr > ();
        break;

Francis Dupont's avatar
Francis Dupont committed
653
      case 150: // "boolean"
654
655
656
        yylhs.value.build< bool > ();
        break;

Francis Dupont's avatar
Francis Dupont committed
657
      case 149: // "floating point"
658
659
660
        yylhs.value.build< double > ();
        break;

Francis Dupont's avatar
Francis Dupont committed
661
      case 148: // "integer"
662
663
664
        yylhs.value.build< int64_t > ();
        break;

Francis Dupont's avatar
Francis Dupont committed
665
      case 147: // "constant string"
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
        yylhs.value.build< std::string > ();
        break;

      default:
        break;
    }


      // Compute the default @$.
      {
        slice<stack_symbol_type, stack_type> slice (yystack_, yylen);
        YYLLOC_DEFAULT (yylhs.location, slice, yylen);
      }

      // Perform the reduction.
      YY_REDUCE_PRINT (yyn);
      try
        {
          switch (yyn)
            {
  case 2:
Francis Dupont's avatar
Francis Dupont committed
687
#line 234 "dhcp4_parser.yy" // lalr1.cc:859
688
    { ctx.ctx_ = ctx.NO_KEYWORD; }
689
#line 690 "dhcp4_parser.cc" // lalr1.cc:859
690
691
692
    break;

  case 4:
Francis Dupont's avatar
Francis Dupont committed
693
#line 235 "dhcp4_parser.yy" // lalr1.cc:859
694
    { ctx.ctx_ = ctx.CONFIG; }
695
#line 696 "dhcp4_parser.cc" // lalr1.cc:859
696
697
698
    break;

  case 6:
Francis Dupont's avatar
Francis Dupont committed
699
#line 236 "dhcp4_parser.yy" // lalr1.cc:859
700
    { ctx.ctx_ = ctx.DHCP4; }
701
#line 702 "dhcp4_parser.cc" // lalr1.cc:859
702
703
704
    break;

  case 8:
Francis Dupont's avatar
Francis Dupont committed
705
#line 237 "dhcp4_parser.yy" // lalr1.cc:859
706
    { ctx.ctx_ = ctx.INTERFACES_CONFIG; }
707
#line 708 "dhcp4_parser.cc" // lalr1.cc:859
708
709
710
    break;

  case 10:
Francis Dupont's avatar
Francis Dupont committed
711
#line 238 "dhcp4_parser.yy" // lalr1.cc:859
712
    { ctx.ctx_ = ctx.SUBNET4; }
713
#line 714 "dhcp4_parser.cc" // lalr1.cc:859
714
715
716
    break;

  case 12:
Francis Dupont's avatar
Francis Dupont committed
717
#line 239 "dhcp4_parser.yy" // lalr1.cc:859
718
    { ctx.ctx_ = ctx.POOLS; }
719
#line 720 "dhcp4_parser.cc" // lalr1.cc:859
720
721
722
    break;

  case 14:
Francis Dupont's avatar
Francis Dupont committed
723
#line 240 "dhcp4_parser.yy" // lalr1.cc:859
724
    { ctx.ctx_ = ctx.RESERVATIONS; }
725
#line 726 "dhcp4_parser.cc" // lalr1.cc:859
726
727
728
    break;

  case 16:
Francis Dupont's avatar
Francis Dupont committed
729
#line 241 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
730
    { ctx.ctx_ = ctx.DHCP4; }
731
#line 732 "dhcp4_parser.cc" // lalr1.cc:859
732
733
734
    break;

  case 18:
Francis Dupont's avatar
Francis Dupont committed
735
#line 242 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
736
    { ctx.ctx_ = ctx.OPTION_DEF; }
737
#line 738 "dhcp4_parser.cc" // lalr1.cc:859
738
739
740
    break;

  case 20:
Francis Dupont's avatar
Francis Dupont committed
741
#line 243 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
742
    { ctx.ctx_ = ctx.OPTION_DATA; }
743
#line 744 "dhcp4_parser.cc" // lalr1.cc:859
744
745
746
    break;

  case 22:
Francis Dupont's avatar
Francis Dupont committed
747
#line 244 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
748
    { ctx.ctx_ = ctx.HOOKS_LIBRARIES; }
749
#line 750 "dhcp4_parser.cc" // lalr1.cc:859
750
751
752
    break;

  case 24:
Francis Dupont's avatar
Francis Dupont committed
753
#line 245 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
754
    { ctx.ctx_ = ctx.DHCP_DDNS; }
755
#line 756 "dhcp4_parser.cc" // lalr1.cc:859
756
757
    break;

758
  case 26:
Francis Dupont's avatar
Francis Dupont committed
759
#line 253 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
760
    { yylhs.value.as< ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); }
761
#line 762 "dhcp4_parser.cc" // lalr1.cc:859
762
763
    break;

764
  case 27:
Francis Dupont's avatar
Francis Dupont committed
765
#line 254 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
766
    { yylhs.value.as< ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as< double > (), ctx.loc2pos(yystack_[0].location))); }
767
#line 768 "dhcp4_parser.cc" // lalr1.cc:859
768
769
    break;

770
  case 28:
Francis Dupont's avatar
Francis Dupont committed
771
#line 255 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
772
    { yylhs.value.as< ElementPtr > () = ElementPtr(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); }
773
#line 774 "dhcp4_parser.cc" // lalr1.cc:859
774
775
    break;

776
  case 29:
Francis Dupont's avatar
Francis Dupont committed
777
#line 256 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
778
    { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); }
779
#line 780 "dhcp4_parser.cc" // lalr1.cc:859
780
781
    break;

782
  case 30:
Francis Dupont's avatar
Francis Dupont committed
783
#line 257 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
784
    { yylhs.value.as< ElementPtr > () = ElementPtr(new NullElement(ctx.loc2pos(yystack_[0].location))); }
785
#line 786 "dhcp4_parser.cc" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
786
787
788
    break;

  case 31:
Francis Dupont's avatar
Francis Dupont committed
789
#line 258 "dhcp4_parser.yy" // lalr1.cc:859
790
    { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
791
#line 792 "dhcp4_parser.cc" // lalr1.cc:859
792
793
    break;

Francis Dupont's avatar
Francis Dupont committed
794
  case 32:
Francis Dupont's avatar
Francis Dupont committed
795
#line 259 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
796
    { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
797
#line 798 "dhcp4_parser.cc" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
798
799
800
    break;

  case 33:
Francis Dupont's avatar
Francis Dupont committed
801
#line 262 "dhcp4_parser.yy" // lalr1.cc:859
802
803
804
805
    {
    // Push back the JSON value on the stack
    ctx.stack_.push_back(yystack_[0].value.as< ElementPtr > ());
}
806
#line 807 "dhcp4_parser.cc" // lalr1.cc:859
807
808
    break;

Francis Dupont's avatar
Francis Dupont committed
809
  case 34:
Francis Dupont's avatar
Francis Dupont committed
810
#line 267 "dhcp4_parser.yy" // lalr1.cc:859
811
812
813
814
815
816
    {
    // This code is executed when we're about to start parsing
    // the content of the map
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(m);
}
817
#line 818 "dhcp4_parser.cc" // lalr1.cc:859
818
819
    break;

Francis Dupont's avatar
Francis Dupont committed
820
  case 35:
Francis Dupont's avatar
Francis Dupont committed
821
#line 272 "dhcp4_parser.yy" // lalr1.cc:859
822
823
824
825
826
    {
    // map parsing completed. If we ever want to do any wrap up
    // (maybe some sanity checking), this would be the best place
    // for it.
}
827
#line 828 "dhcp4_parser.cc" // lalr1.cc:859
828
829
    break;

Francis Dupont's avatar
Francis Dupont committed
830
  case 36:
Francis Dupont's avatar
Francis Dupont committed
831
#line 278 "dhcp4_parser.yy" // lalr1.cc:859
832
    { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); }
833
#line 834 "dhcp4_parser.cc" // lalr1.cc:859
834
835
    break;

Francis Dupont's avatar
Francis Dupont committed
836
  case 39:
Francis Dupont's avatar
Francis Dupont committed
837
#line 285 "dhcp4_parser.yy" // lalr1.cc:859
838
839
840
841
    {
                  // map containing a single entry
                  ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ());
                  }
842
#line 843 "dhcp4_parser.cc" // lalr1.cc:859
843
844
    break;

Francis Dupont's avatar
Francis Dupont committed
845
  case 40:
Francis Dupont's avatar
Francis Dupont committed
846
#line 289 "dhcp4_parser.yy" // lalr1.cc:859
847
848
849
850
851
    {
                  // map consisting of a shorter map followed by
                  // comma and string:value
                  ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ());
                  }
852
#line 853 "dhcp4_parser.cc" // lalr1.cc:859
853
854
    break;

Francis Dupont's avatar
Francis Dupont committed
855
  case 41:
Francis Dupont's avatar
Francis Dupont committed
856
#line 296 "dhcp4_parser.yy" // lalr1.cc:859
857
858
859
860
    {
    ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(l);
}
861
#line 862 "dhcp4_parser.cc" // lalr1.cc:859
862
863
    break;

Francis Dupont's avatar
Francis Dupont committed
864
  case 42:
Francis Dupont's avatar
Francis Dupont committed
865
#line 299 "dhcp4_parser.yy" // lalr1.cc:859
866
867
868
    {
    // list parsing complete. Put any sanity checking here
}
869
#line 870 "dhcp4_parser.cc" // lalr1.cc:859
870
871
    break;

Francis Dupont's avatar
Francis Dupont committed
872
  case 45:
Francis Dupont's avatar
Francis Dupont committed
873
#line 307 "dhcp4_parser.yy" // lalr1.cc:859
874
875
876
877
    {
                  // List consisting of a single element.
                  ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ());
                  }
878
#line 879 "dhcp4_parser.cc" // lalr1.cc:859
879
880
    break;

Francis Dupont's avatar
Francis Dupont committed
881
  case 46:
Francis Dupont's avatar
Francis Dupont committed
882
#line 311 "dhcp4_parser.yy" // lalr1.cc:859
883
884
885
886
    {
                  // List ending with , and a value.
                  ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ());
                  }
887
#line 888 "dhcp4_parser.cc" // lalr1.cc:859
888
889
    break;

Francis Dupont's avatar
Francis Dupont committed
890
  case 47:
Francis Dupont's avatar
Francis Dupont committed
891
#line 318 "dhcp4_parser.yy" // lalr1.cc:859
892
893
894
    {
    // List parsing about to start
}
895
#line 896 "dhcp4_parser.cc" // lalr1.cc:859
896
897
    break;

Francis Dupont's avatar
Francis Dupont committed
898
  case 48:
Francis Dupont's avatar
Francis Dupont committed
899
#line 320 "dhcp4_parser.yy" // lalr1.cc:859
900
901
902
903
    {
    // list parsing complete. Put any sanity checking here
    //ctx.stack_.pop_back();
}
904
#line 905 "dhcp4_parser.cc" // lalr1.cc:859
905
906
    break;

Francis Dupont's avatar
Francis Dupont committed
907
  case 51:
Francis Dupont's avatar
Francis Dupont committed
908
#line 329 "dhcp4_parser.yy" // lalr1.cc:859
909
    {
910
911
912
                          ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
                          ctx.stack_.back()->add(s);
                          }
913
#line 914 "dhcp4_parser.cc" // lalr1.cc:859
914
915
    break;

Francis Dupont's avatar
Francis Dupont committed
916
  case 52:
Francis Dupont's avatar
Francis Dupont committed
917
#line 333 "dhcp4_parser.yy" // lalr1.cc:859
918
    {
919
920
921
                          ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
                          ctx.stack_.back()->add(s);
                          }
922
#line 923 "dhcp4_parser.cc" // lalr1.cc:859
923
924
    break;

Francis Dupont's avatar
Francis Dupont committed
925
  case 53:
Francis Dupont's avatar
Francis Dupont committed
926
#line 344 "dhcp4_parser.yy" // lalr1.cc:859
927
928
929
930
931
932
    {
    const std::string& where = ctx.contextName();
    const std::string& keyword = yystack_[1].value.as< std::string > ();
    error(yystack_[1].location,
          "got unexpected keyword \"" + keyword + "\" in " + where + " map.");
}
933
#line 934 "dhcp4_parser.cc" // lalr1.cc:859
934
935
    break;

Francis Dupont's avatar
Francis Dupont committed
936
  case 54:
Francis Dupont's avatar
Francis Dupont committed
937
#line 354 "dhcp4_parser.yy" // lalr1.cc:859
938
939
940
941
942
943
    {
    // This code is executed when we're about to start parsing
    // the content of the map
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(m);
}
944
#line 945 "dhcp4_parser.cc" // lalr1.cc:859
945
946
    break;

Francis Dupont's avatar
Francis Dupont committed
947
  case 55:
Francis Dupont's avatar
Francis Dupont committed
948
#line 359 "dhcp4_parser.yy" // lalr1.cc:859
949
950
951
952
    {
    // map parsing completed. If we ever want to do any wrap up
    // (maybe some sanity checking), this would be the best place
    // for it.
Francis Dupont's avatar
Francis Dupont committed
953
954
955

    // Dhcp4 is required
    ctx.require("Dhcp4", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
956
}
957
#line 958 "dhcp4_parser.cc" // lalr1.cc:859
958
959
    break;

Francis Dupont's avatar
Francis Dupont committed
960
  case 64:
Francis Dupont's avatar
Francis Dupont committed
961
#line 383 "dhcp4_parser.yy" // lalr1.cc:859
962
963
964
965
966
967
968
969
    {
    // This code is executed when we're about to start parsing
    // the content of the map
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("Dhcp4", m);
    ctx.stack_.push_back(m);
    ctx.enter(ctx.DHCP4);
}
970
#line 971 "dhcp4_parser.cc" // lalr1.cc:859
971
972
    break;

Francis Dupont's avatar
Francis Dupont committed
973
  case 65:
Francis Dupont's avatar
Francis Dupont committed
974
#line 390 "dhcp4_parser.yy" // lalr1.cc:859
975
    {
Francis Dupont's avatar
Francis Dupont committed
976
    // No global parameter is required
977
978
979
    ctx.stack_.pop_back();
    ctx.leave();
}
980
#line 981 "dhcp4_parser.cc" // lalr1.cc:859
981
982
    break;

Francis Dupont's avatar
Francis Dupont committed
983
  case 66:
Francis Dupont's avatar
Francis Dupont committed
984
#line 398 "dhcp4_parser.yy" // lalr1.cc:859
985
    {
Francis Dupont's avatar
Francis Dupont committed
986
    // Parse the Dhcp4 map
987
988
989
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(m);
}
990
#line 991 "dhcp4_parser.cc" // lalr1.cc:859
991
992
    break;

Francis Dupont's avatar
Francis Dupont committed
993
  case 67:
Francis Dupont's avatar
Francis Dupont committed
994
#line 402 "dhcp4_parser.yy" // lalr1.cc:859
995
    {
Francis Dupont's avatar
Francis Dupont committed
996
    // No global parameter is required
997
998
    // parsing completed
}
999
#line 1000 "dhcp4_parser.cc" // lalr1.cc:859
1000
1001
    break;

Francis Dupont's avatar
Francis Dupont committed
1002
1003
  case 96:
#line 441 "dhcp4_parser.yy" // lalr1.cc:859
1004
1005
1006
1007
    {
    ElementPtr prf(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("valid-lifetime", prf);
}
1008
#line 1009 "dhcp4_parser.cc" // lalr1.cc:859
1009
1010
    break;

Francis Dupont's avatar
Francis Dupont committed
1011
1012
  case 97:
#line 446 "dhcp4_parser.yy" // lalr1.cc:859
1013
1014
1015
1016
    {
    ElementPtr prf(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("renew-timer", prf);
}
1017
#line 1018 "dhcp4_parser.cc" // lalr1.cc:859
1018
1019
    break;

Francis Dupont's avatar
Francis Dupont committed
1020
1021
  case 98:
#line 451 "dhcp4_parser.yy" // lalr1.cc:859
1022
1023
1024
1025
    {
    ElementPtr prf(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("rebind-timer", prf);
}
1026
#line 1027 "dhcp4_parser.cc" // lalr1.cc:859
1027
1028
    break;

Francis Dupont's avatar
Francis Dupont committed
1029
1030
  case 99:
#line 456 "dhcp4_parser.yy" // lalr1.cc:859
1031
1032
1033
1034
    {
    ElementPtr dpp(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("decline-probation-period", dpp);
}
1035
#line 1036 "dhcp4_parser.cc" // lalr1.cc:859
1036
1037
    break;

Francis Dupont's avatar
Francis Dupont committed
1038
1039
  case 100:
#line 461 "dhcp4_parser.yy" // lalr1.cc:859
1040
    {
Francis Dupont's avatar
Francis Dupont committed
1041
    ElementPtr echo(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
1042
1043
    ctx.stack_.back()->set("echo-client-id", echo);
}
1044
#line 1045 "dhcp4_parser.cc" // lalr1.cc:859
1045
1046
    break;

Francis Dupont's avatar
Francis Dupont committed
1047
1048
  case 101:
#line 466 "dhcp4_parser.yy" // lalr1.cc:859
1049
    {
Francis Dupont's avatar
Francis Dupont committed
1050
    ElementPtr match(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
1051
1052
    ctx.stack_.back()->set("match-client-id", match);
}
1053
#line 1054 "dhcp4_parser.cc" // lalr1.cc:859
1054
1055
    break;

Francis Dupont's avatar
Francis Dupont committed
1056
1057
  case 102:
#line 472 "dhcp4_parser.yy" // lalr1.cc:859
1058
1059
1060
1061
1062
1063
    {
    ElementPtr i(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("interfaces-config", i);
    ctx.stack_.push_back(i);
    ctx.enter(ctx.INTERFACES_CONFIG);
}
1064
#line 1065 "dhcp4_parser.cc" // lalr1.cc:859
1065
1066
    break;

Francis Dupont's avatar
Francis Dupont committed
1067
1068
  case 103:
#line 477 "dhcp4_parser.yy" // lalr1.cc:859
1069
    {
Francis Dupont's avatar
Francis Dupont committed
1070
    // No interfaces config param is required
1071
1072
1073
    ctx.stack_.pop_back();
    ctx.leave();
}
1074
#line 1075 "dhcp4_parser.cc" // lalr1.cc:859
1075
1076
    break;

Francis Dupont's avatar
Francis Dupont committed
1077
1078
  case 113:
#line 496 "dhcp4_parser.yy" // lalr1.cc:859
1079
1080
1081
1082
1083
    {
    // Parse the interfaces-config map
    ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.push_back(m);
}
1084
#line 1085 "dhcp4_parser.cc" // lalr1.cc:859
1085
1086
    break;

Francis Dupont's avatar
Francis Dupont committed
1087
1088
  case 114:
#line 500 "dhcp4_parser.yy" // lalr1.cc:859
1089
    {
Francis Dupont's avatar
Francis Dupont committed
1090
    // No interfaces config param is required
1091
1092
    // parsing completed
}
1093
#line 1094 "dhcp4_parser.cc" // lalr1.cc:859
1094
1095
    break;

Francis Dupont's avatar
Francis Dupont committed
1096
1097
  case 115:
#line 505 "dhcp4_parser.yy" // lalr1.cc:859
1098
1099
1100
1101
1102
1103
    {
    ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("interfaces", l);
    ctx.stack_.push_back(l);
    ctx.enter(ctx.NO_KEYWORD);
}
1104
#line 1105 "dhcp4_parser.cc" // lalr1.cc:859
1105
1106
    break;

Francis Dupont's avatar
Francis Dupont committed
1107
1108
  case 116:
#line 510 "dhcp4_parser.yy" // lalr1.cc:859
1109
1110
1111
1112
    {
    ctx.stack_.pop_back();
    ctx.leave();
}
1113
#line 1114 "dhcp4_parser.cc" // lalr1.cc:859
1114
1115
    break;

Francis Dupont's avatar
Francis Dupont committed
1116
1117
  case 117:
#line 515 "dhcp4_parser.yy" // lalr1.cc:859
1118
    {
1119
    ctx.enter(ctx.DHCP_SOCKET_TYPE);
1120
}
1121
#line 1122 "dhcp4_parser.cc" // lalr1.cc:859
1122
1123
    break;

Francis Dupont's avatar
Francis Dupont committed
1124
1125
  case 118:
#line 517 "dhcp4_parser.yy" // lalr1.cc:859
1126
    {
1127
    ctx.stack_.back()->set("dhcp-socket-type", yystack_[0].value.as< ElementPtr > ());
1128
1129
    ctx.leave();
}
1130
#line 1131 "dhcp4_parser.cc" // lalr1.cc:859
1131
1132
    break;

Francis Dupont's avatar
Francis Dupont committed
1133
1134
  case 119:
#line 522 "dhcp4_parser.yy" // lalr1.cc:859
1135
    { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("raw", ctx.loc2pos(yystack_[0].location))); }
1136
#line 1137 "dhcp4_parser.cc" // lalr1.cc:859
1137
1138
    break;

Francis Dupont's avatar
Francis Dupont committed
1139
1140
  case 120:
#line 523 "dhcp4_parser.yy" // lalr1.cc:859
1141
    { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("udp", ctx.loc2pos(yystack_[0].location))); }
1142
#line 1143 "dhcp4_parser.cc" // lalr1.cc:859
1143
1144
    break;

Francis Dupont's avatar
Francis Dupont committed
1145
1146
  case 121:
#line 526 "dhcp4_parser.yy" // lalr1.cc:859
1147
1148
1149
1150
1151
1152
    {
    ctx.enter(ctx.OUTBOUND_INTERFACE);
}
#line 1151 "dhcp4_parser.cc" // lalr1.cc:859
    break;

Francis Dupont's avatar
Francis Dupont committed
1153
1154
  case 122:
#line 528 "dhcp4_parser.yy" // lalr1.cc:859
1155
1156
1157
1158
1159
1160
1161
    {
    ctx.stack_.back()->set("outbound-interface", yystack_[0].value.as< ElementPtr > ());
    ctx.leave();
}
#line 1160 "dhcp4_parser.cc" // lalr1.cc:859
    break;

Francis Dupont's avatar
Francis Dupont committed
1162
1163
  case 123:
#line 533 "dhcp4_parser.yy" // lalr1.cc:859
1164
1165
1166
1167
1168
1169
    {
    yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("same-as-inbound", ctx.loc2pos(yystack_[0].location)));
}
#line 1168 "dhcp4_parser.cc" // lalr1.cc:859
    break;

Francis Dupont's avatar
Francis Dupont committed
1170
1171
  case 124:
#line 535 "dhcp4_parser.yy" // lalr1.cc:859
1172
1173
1174
1175
1176
1177
    {
    yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("use-routing", ctx.loc2pos(yystack_[0].location)));
    }
#line 1176 "dhcp4_parser.cc" // lalr1.cc:859
    break;

Francis Dupont's avatar
Francis Dupont committed
1178
1179
  case 125:
#line 539 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
1180
1181
1182
1183
    {
    ElementPtr b(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("re-detect", b);
}
1184
#line 1185 "dhcp4_parser.cc" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
1185
1186
    break;

Francis Dupont's avatar
Francis Dupont committed
1187
1188
  case 126:
#line 545 "dhcp4_parser.yy" // lalr1.cc:859
1189
1190
1191
1192
1193
1194
    {
    ElementPtr i(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("lease-database", i);
    ctx.stack_.push_back(i);
    ctx.enter(ctx.LEASE_DATABASE);
}
1195
#line 1196 "dhcp4_parser.cc" // lalr1.cc:859
1196
1197
    break;

Francis Dupont's avatar
Francis Dupont committed
1198
1199
  case 127:
#line 550 "dhcp4_parser.yy" // lalr1.cc:859
1200
    {
Francis Dupont's avatar
Francis Dupont committed
1201
1202
    // The type parameter is required
    ctx.require("type", ctx.loc2pos(yystack_[2].location), ctx.loc2pos(yystack_[0].location));
1203
1204
1205
    ctx.stack_.pop_back();
    ctx.leave();
}
1206
#line 1207 "dhcp4_parser.cc" // lalr1.cc:859
1207
1208
    break;

Francis Dupont's avatar
Francis Dupont committed
1209
1210
  case 128:
#line 557 "dhcp4_parser.yy" // lalr1.cc:859
1211
1212
1213
1214
1215
1216
    {
    ElementPtr i(new MapElement(ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("hosts-database", i);
    ctx.stack_.push_back(i);
    ctx.enter(ctx.HOSTS_DATABASE);
}
1217
#line 1218 "dhcp4_parser.cc" // lalr1.cc:859
1218
1219
    break;

Francis Dupont's avatar
Francis Dupont committed
1220
1221
  case 129:
#line 562 "dhcp4_parser.yy" // lalr1.cc:859
1222
    {
Francis Dupont's avatar
Francis Dupont committed
1223
1224
    // The type parameter is required
    ctx.require("type", ctx.loc2pos(yystack_[2].location), ctx.loc2pos(yystack_[0].location));
1225
1226
1227
    ctx.stack_.pop_back();
    ctx.leave();
}
1228
#line 1229 "dhcp4_parser.cc" // lalr1.cc:859
1229
1230
    break;

Francis Dupont's avatar
Francis Dupont committed
1231
1232
  case 147:
#line 590 "dhcp4_parser.yy" // lalr1.cc:859
1233
    {
1234
    ctx.enter(ctx.DATABASE_TYPE);
1235
}
1236
#line 1237 "dhcp4_parser.cc" // lalr1.cc:859
1237
1238
    break;

Francis Dupont's avatar
Francis Dupont committed
1239
1240
  case 148:
#line 592 "dhcp4_parser.yy" // lalr1.cc:859
1241
    {
1242
    ctx.stack_.back()->set("type", yystack_[0].value.as< ElementPtr > ());
1243
1244
    ctx.leave();
}
1245
#line 1246 "dhcp4_parser.cc" // lalr1.cc:859
1246
1247
    break;

Francis Dupont's avatar
Francis Dupont committed
1248
1249
  case 149:
#line 597 "dhcp4_parser.yy" // lalr1.cc:859
1250
    { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("memfile", ctx.loc2pos(yystack_[0].location))); }
1251
#line 1252 "dhcp4_parser.cc" // lalr1.cc:859
1252
1253
    break;

Francis Dupont's avatar
Francis Dupont committed
1254
1255
  case 150:
#line 598 "dhcp4_parser.yy" // lalr1.cc:859
1256
    { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("mysql", ctx.loc2pos(yystack_[0].location))); }
1257
#line 1258 "dhcp4_parser.cc" // lalr1.cc:859
1258
1259
    break;

Francis Dupont's avatar
Francis Dupont committed
1260
1261
  case 151:
#line 599 "dhcp4_parser.yy" // lalr1.cc:859
1262
    { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("postgresql", ctx.loc2pos(yystack_[0].location))); }
1263
#line 1264 "dhcp4_parser.cc" // lalr1.cc:859
1264
1265
    break;

Francis Dupont's avatar
Francis Dupont committed
1266
1267
  case 152:
#line 600 "dhcp4_parser.yy" // lalr1.cc:859
1268
    { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("cql", ctx.loc2pos(yystack_[0].location))); }
1269
#line 1270 "dhcp4_parser.cc" // lalr1.cc:859
1270
1271
    break;

Francis Dupont's avatar
Francis Dupont committed
1272
1273
  case 153:
#line 603 "dhcp4_parser.yy" // lalr1.cc:859
1274
1275
1276
    {
    ctx.enter(ctx.NO_KEYWORD);
}
1277
#line 1278 "dhcp4_parser.cc" // lalr1.cc:859
1278
1279
    break;

Francis Dupont's avatar
Francis Dupont committed
1280
1281
  case 154:
#line 605 "dhcp4_parser.yy" // lalr1.cc:859
1282
1283
1284
1285
1286
    {
    ElementPtr user(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("user", user);
    ctx.leave();
}
1287
#line 1288 "dhcp4_parser.cc" // lalr1.cc:859
1288
1289
    break;

Francis Dupont's avatar
Francis Dupont committed
1290
1291
  case 155:
#line 611 "dhcp4_parser.yy" // lalr1.cc:859
1292
1293
1294
    {
    ctx.enter(ctx.NO_KEYWORD);
}
1295
#line 1296 "dhcp4_parser.cc" // lalr1.cc:859
1296
1297
    break;

Francis Dupont's avatar
Francis Dupont committed
1298
1299
  case 156:
#line 613 "dhcp4_parser.yy" // lalr1.cc:859
1300
1301
1302
1303
1304
    {
    ElementPtr pwd(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("password", pwd);
    ctx.leave();
}
1305
#line 1306 "dhcp4_parser.cc" // lalr1.cc:859
1306
1307
    break;

Francis Dupont's avatar
Francis Dupont committed
1308
1309
  case 157:
#line 619 "dhcp4_parser.yy" // lalr1.cc:859
1310
1311
1312
    {
    ctx.enter(ctx.NO_KEYWORD);
}
1313
#line 1314 "dhcp4_parser.cc" // lalr1.cc:859
1314
1315
    break;

Francis Dupont's avatar
Francis Dupont committed
1316
1317
  case 158:
#line 621 "dhcp4_parser.yy" // lalr1.cc:859
1318
1319
1320
1321
1322
    {
    ElementPtr h(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("host", h);
    ctx.leave();
}
1323
#line 1324 "dhcp4_parser.cc" // lalr1.cc:859
1324
1325
    break;

Francis Dupont's avatar
Francis Dupont committed
1326
1327
  case 159:
#line 627 "dhcp4_parser.yy" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
1328
1329
1330
1331
    {
    ElementPtr p(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("port", p);
}
1332
#line 1333 "dhcp4_parser.cc" // lalr1.cc:859
Francis Dupont's avatar
Francis Dupont committed
1333
1334
    break;

Francis Dupont's avatar
Francis Dupont committed
1335
1336
  case 160:
#line 632 "dhcp4_parser.yy" // lalr1.cc:859
1337
1338
1339
    {
    ctx.enter(ctx.NO_KEYWORD);
}
1340
#line 1341 "dhcp4_parser.cc" // lalr1.cc:859
1341
1342
    break;

Francis Dupont's avatar
Francis Dupont committed
1343
1344
  case 161:
#line 634 "dhcp4_parser.yy" // lalr1.cc:859
1345
1346
1347
1348
1349
    {
    ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("name", name);
    ctx.leave();
}
1350
#line 1351 "dhcp4_parser.cc" // lalr1.cc:859
1351
1352
    break;

Francis Dupont's avatar
Francis Dupont committed
1353
1354
  case 162:
#line 640 "dhcp4_parser.yy" // lalr1.cc:859
1355
1356
1357
1358
    {
    ElementPtr n(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("persist", n);
}
1359
#line 1360 "dhcp4_parser.cc" // lalr1.cc:859
1360
1361
    break;

Francis Dupont's avatar
Francis Dupont committed
1362
1363
  case 163:
#line 645 "dhcp4_parser.yy" // lalr1.cc:859
1364
1365
1366
1367
    {
    ElementPtr n(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
    ctx.stack_.back()->set("lfc-interval", n);
}