From: Tomek Mrugalski Date: Thu, 15 Dec 2016 15:54:01 +0000 (+0100) Subject: [5017] Added generated flex/bison files. X-Git-Tag: trac5088_base~1^2~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa3199aeb5fb9c87d521670d1667c5db4ed2bac6;p=thirdparty%2Fkea.git [5017] Added generated flex/bison files. --- diff --git a/src/bin/dhcp4/dhcp4_lexer.cc b/src/bin/dhcp4/dhcp4_lexer.cc new file mode 100644 index 0000000000..177c7025f2 --- /dev/null +++ b/src/bin/dhcp4/dhcp4_lexer.cc @@ -0,0 +1,3900 @@ +#line 2 "dhcp4_lexer.cc" + +#line 4 "dhcp4_lexer.cc" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +/* %not-for-header */ + +/* %if-c-only */ +/* %if-not-reentrant */ +#define yy_create_buffer parser4__create_buffer +#define yy_delete_buffer parser4__delete_buffer +#define yy_flex_debug parser4__flex_debug +#define yy_init_buffer parser4__init_buffer +#define yy_flush_buffer parser4__flush_buffer +#define yy_load_buffer_state parser4__load_buffer_state +#define yy_switch_to_buffer parser4__switch_to_buffer +#define yyin parser4_in +#define yyleng parser4_leng +#define yylex parser4_lex +#define yylineno parser4_lineno +#define yyout parser4_out +#define yyrestart parser4_restart +#define yytext parser4_text +#define yywrap parser4_wrap +#define yyalloc parser4_alloc +#define yyrealloc parser4_realloc +#define yyfree parser4_free + +/* %endif */ +/* %endif */ +/* %ok-for-header */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* %if-c++-only */ +/* %endif */ + +/* %if-c-only */ + +/* %endif */ + +/* %if-c-only */ + +/* %endif */ + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +/* %if-c-only */ +#include +#include +#include +#include +/* %endif */ + +/* %if-tables-serialization */ +/* %endif */ +/* end standard C headers. */ + +/* %if-c-or-c++ */ +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* %endif */ + +/* %if-c++-only */ +/* %endif */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* %not-for-header */ + +/* Returned upon end-of-file. */ +#define YY_NULL 0 +/* %ok-for-header */ + +/* %not-for-header */ + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +/* %ok-for-header */ + +/* %if-reentrant */ +/* %endif */ + +/* %if-not-reentrant */ + +/* %endif */ + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE parser4_restart(parser4_in ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +/* %if-not-reentrant */ +extern yy_size_t parser4_leng; +/* %endif */ + +/* %if-c-only */ +/* %if-not-reentrant */ +extern FILE *parser4_in, *parser4_out; +/* %endif */ +/* %endif */ + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up parser4_text. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up parser4_text again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { +/* %if-c-only */ + FILE *yy_input_file; +/* %endif */ + +/* %if-c++-only */ +/* %endif */ + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via parser4_restart()), so that the user can continue scanning by + * just pointing parser4_in at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* %if-c-only Standard (non-C++) definition */ +/* %not-for-header */ + +/* %if-not-reentrant */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +/* %endif */ +/* %ok-for-header */ + +/* %endif */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* %if-c-only Standard (non-C++) definition */ + +/* %if-not-reentrant */ +/* %not-for-header */ + +/* yy_hold_char holds the character lost when parser4_text is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t parser4_leng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow parser4_wrap()'s to do buffer switches + * instead of setting up a fresh parser4_in. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; +/* %ok-for-header */ + +/* %endif */ + +void parser4_restart (FILE *input_file ); +void parser4__switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE parser4__create_buffer (FILE *file,int size ); +void parser4__delete_buffer (YY_BUFFER_STATE b ); +void parser4__flush_buffer (YY_BUFFER_STATE b ); +void parser4_push_buffer_state (YY_BUFFER_STATE new_buffer ); +void parser4_pop_buffer_state (void ); + +static void parser4_ensure_buffer_stack (void ); +static void parser4__load_buffer_state (void ); +static void parser4__init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER parser4__flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE parser4__scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE parser4__scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE parser4__scan_bytes (yyconst char *bytes,yy_size_t len ); + +/* %endif */ + +void *parser4_alloc (yy_size_t ); +void *parser4_realloc (void *,yy_size_t ); +void parser4_free (void * ); + +#define yy_new_buffer parser4__create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + parser4_ensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + parser4__create_buffer(parser4_in,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + parser4_ensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + parser4__create_buffer(parser4_in,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* %% [1.0] parser4_text/parser4_in/parser4_out/yy_state_type/parser4_lineno etc. def's & init go here */ +/* Begin user sect3 */ + +#define parser4_wrap() (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +#define FLEX_DEBUG + +typedef unsigned char YY_CHAR; + +FILE *parser4_in = (FILE *) 0, *parser4_out = (FILE *) 0; + +typedef int yy_state_type; + +extern int parser4_lineno; + +int parser4_lineno = 1; + +extern char *parser4_text; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr parser4_text + +/* %% [1.5] DFA */ + +/* %if-c-only Standard (non-C++) definition */ + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif +static void yy_fatal_error (yyconst char msg[] ); + +/* %endif */ + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up parser4_text. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ +/* %% [2.0] code to fiddle parser4_text and parser4_leng for yymore() goes here \ */\ + parser4_leng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ +/* %% [3.0] code to copy yytext_ptr to parser4_text[] goes here, if %array \ */\ + (yy_c_buf_p) = yy_cp; + +/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ +#define YY_NUM_RULES 99 +#define YY_END_OF_BUFFER 100 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[692] = + { 0, + 95, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 100, 98, 10, 11, 98, 1, 95, 92, 95, 95, + 98, 94, 93, 98, 98, 88, 89, 98, 98, 98, + 90, 91, 5, 5, 5, 98, 98, 98, 10, 11, + 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 95, 95, 0, 94, 95, 3, 2, + 6, 0, 95, 0, 0, 0, 4, 0, 0, 9, + 0, 85, 0, 0, 0, 0, 0, 87, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 0, 0, 0, 8, 0, 0, 0, 0, 0, 86, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 97, 96, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 41, 0, 0, 32, 0, 0, 0, + 0, 53, 0, 0, 0, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, + 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, + 71, 18, 19, 0, 0, 0, 0, 0, 0, 80, + 12, 0, 0, 62, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 33, 0, 0, 0, 0, 63, 0, + 0, 0, 0, 0, 58, 0, 0, 0, 7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 35, 0, 0, 0, 0, 0, 0, 43, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 67, 44, 0, 0, 0, 0, 22, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, + 75, 0, 0, 81, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 20, 0, 17, 0, 0, 0, 0, 0, 48, 0, + + 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, + 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, + 0, 83, 56, 0, 0, 59, 47, 0, 0, 0, + 0, 0, 0, 0, 0, 54, 69, 0, 14, 0, + 64, 0, 0, 0, 29, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 30, 0, 0, 0, 0, 25, 0, 0, 78, 77, + + 0, 0, 50, 0, 0, 0, 74, 0, 0, 0, + 0, 0, 37, 0, 0, 23, 0, 39, 26, 60, + 0, 52, 0, 82, 0, 0, 0, 72, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 49, 76, 0, + 0, 0, 0, 16, 0, 15, 45, 0, 24, 0, + 0, 65, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 27, 0, 0, 73, 0, 0, 0, 42, + 0 + + } ; + +static yyconst YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 5, 6, 7, 5, 5, 5, 5, 5, + 5, 8, 9, 10, 11, 12, 13, 14, 14, 14, + 14, 15, 14, 16, 14, 14, 14, 17, 5, 18, + 5, 19, 20, 5, 21, 21, 21, 22, 23, 21, + 5, 5, 5, 5, 5, 24, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 25, 26, 27, 5, 28, 5, 29, 30, 31, 32, + + 33, 34, 35, 36, 37, 5, 38, 39, 40, 41, + 42, 43, 5, 44, 45, 46, 47, 48, 49, 50, + 51, 5, 52, 5, 53, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5 + } ; + +static yyconst YY_CHAR yy_meta[54] = + { 0, + 1, 1, 2, 3, 3, 4, 3, 3, 3, 3, + 3, 3, 5, 6, 6, 6, 3, 3, 3, 3, + 6, 6, 6, 3, 3, 5, 3, 3, 6, 7, + 6, 6, 6, 7, 3, 3, 3, 3, 3, 3, + 5, 3, 3, 5, 3, 5, 5, 3, 3, 3, + 3, 3, 3 + } ; + +static yyconst flex_uint16_t yy_base[704] = + { 0, + 0, 0, 52, 55, 58, 0, 56, 60, 41, 57, + 954, 955, 78, 950, 111, 0, 153, 955, 158, 73, + 71, 173, 955, 932, 168, 955, 955, 922, 903, 905, + 955, 955, 955, 96, 935, 906, 0, 927, 99, 942, + 169, 192, 955, 902, 907, 900, 235, 897, 155, 172, + 130, 169, 161, 209, 911, 43, 170, 76, 211, 176, + 894, 193, 0, 241, 271, 257, 276, 282, 955, 0, + 955, 286, 292, 899, 898, 889, 955, 904, 928, 955, + 172, 955, 886, 916, 900, 895, 923, 0, 302, 884, + 883, 889, 218, 877, 878, 77, 892, 885, 186, 878, + + 207, 869, 908, 214, 872, 906, 887, 884, 884, 878, + 872, 865, 864, 218, 865, 866, 864, 281, 236, 875, + 876, 874, 858, 862, 858, 867, 860, 854, 0, 852, + 857, 862, 855, 955, 0, 882, 849, 856, 884, 955, + 323, 860, 857, 854, 853, 839, 873, 854, 835, 842, + 837, 847, 849, 844, 839, 837, 828, 830, 843, 955, + 830, 837, 840, 823, 856, 822, 830, 831, 826, 819, + 832, 815, 814, 819, 820, 824, 818, 812, 824, 819, + 818, 802, 816, 810, 816, 805, 799, 811, 810, 798, + 804, 795, 806, 955, 955, 791, 0, 230, 325, 800, + + 344, 785, 788, 793, 827, 788, 797, 824, 794, 791, + 278, 821, 783, 781, 780, 778, 357, 789, 789, 774, + 775, 786, 784, 779, 786, 781, 807, 770, 764, 770, + 760, 771, 297, 775, 764, 764, 760, 752, 753, 757, + 767, 755, 765, 764, 763, 789, 788, 787, 786, 759, + 753, 757, 0, 747, 740, 780, 779, 752, 742, 389, + 776, 744, 734, 955, 737, 736, 955, 738, 735, 743, + 732, 955, 728, 729, 738, 759, 955, 725, 739, 756, + 760, 733, 727, 729, 730, 750, 719, 715, 714, 955, + 716, 710, 722, 712, 708, 955, 746, 740, 709, 717, + + 716, 741, 735, 697, 700, 706, 696, 735, 694, 955, + 955, 955, 955, 728, 696, 704, 0, 690, 705, 955, + 955, 693, 698, 955, 686, 720, 691, 685, 695, 694, + 694, 709, 677, 679, 690, 682, 687, 679, 686, 955, + 673, 682, 686, 670, 681, 666, 660, 665, 698, 315, + 662, 663, 660, 955, 674, 665, 692, 691, 955, 655, + 671, 688, 652, 686, 955, 313, 657, 654, 955, 661, + 652, 647, 685, 679, 333, 678, 648, 639, 675, 644, + 673, 644, 645, 670, 643, 634, 645, 648, 643, 638, + 643, 640, 643, 638, 664, 663, 636, 955, 625, 633, + + 633, 658, 621, 611, 615, 614, 622, 612, 620, 605, + 338, 955, 649, 617, 647, 608, 618, 644, 955, 612, + 609, 615, 601, 616, 611, 600, 597, 598, 611, 594, + 599, 607, 603, 629, 588, 588, 599, 598, 585, 583, + 584, 955, 955, 352, 584, 582, 619, 955, 584, 617, + 585, 570, 580, 582, 586, 611, 587, 564, 955, 580, + 955, 579, 566, 955, 579, 581, 603, 566, 561, 567, + 561, 598, 561, 556, 568, 567, 555, 554, 955, 568, + 551, 551, 380, 549, 564, 544, 545, 556, 543, 543, + 955, 547, 955, 546, 542, 551, 541, 576, 955, 541, + + 537, 546, 549, 571, 570, 530, 955, 543, 567, 566, + 529, 955, 526, 536, 557, 538, 537, 517, 534, 557, + 556, 955, 524, 376, 554, 529, 529, 528, 550, 518, + 548, 516, 519, 518, 506, 508, 955, 515, 514, 500, + 514, 955, 955, 499, 505, 955, 955, 512, 495, 534, + 502, 493, 493, 507, 506, 955, 955, 502, 955, 502, + 955, 503, 492, 524, 955, 487, 955, 482, 483, 481, + 519, 284, 518, 517, 485, 488, 355, 487, 490, 512, + 955, 485, 483, 478, 468, 468, 506, 469, 465, 503, + 955, 467, 501, 500, 499, 955, 464, 497, 955, 955, + + 462, 495, 955, 455, 453, 452, 955, 491, 451, 462, + 457, 460, 955, 451, 458, 955, 445, 955, 955, 955, + 447, 955, 455, 955, 481, 480, 448, 955, 459, 417, + 401, 435, 400, 418, 411, 384, 409, 955, 955, 372, + 370, 403, 367, 955, 370, 955, 955, 373, 955, 360, + 356, 955, 388, 362, 390, 384, 352, 356, 386, 955, + 347, 358, 351, 955, 347, 339, 69, 122, 145, 169, + 193, 200, 214, 228, 240, 241, 281, 273, 293, 324, + 313, 312, 955, 344, 318, 955, 318, 324, 365, 955, + 955, 425, 432, 439, 446, 453, 460, 464, 469, 471, + + 473, 475, 477 + } ; + +static yyconst flex_int16_t yy_def[704] = + { 0, + 691, 1, 692, 692, 1, 5, 5, 5, 5, 5, + 691, 691, 691, 691, 691, 693, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 691, 694, 691, 691, 691, + 695, 15, 691, 42, 42, 42, 696, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 693, 691, 691, 691, 691, 691, 691, 697, + 691, 691, 691, 691, 691, 691, 691, 691, 694, 691, + 695, 691, 698, 42, 42, 42, 699, 42, 696, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 697, 691, + 691, 691, 691, 691, 700, 42, 42, 42, 699, 691, + 696, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 691, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 691, 691, 691, 691, 701, 42, 42, 42, + + 696, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 691, 702, 42, 42, 42, 42, 42, 42, 696, + 42, 42, 42, 691, 42, 42, 691, 42, 42, 42, + 42, 691, 42, 42, 42, 42, 691, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 691, + 42, 42, 42, 42, 42, 691, 42, 42, 42, 42, + + 42, 42, 42, 42, 42, 42, 42, 42, 42, 691, + 691, 691, 691, 42, 42, 691, 703, 42, 42, 691, + 691, 42, 42, 691, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 691, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 691, 42, 42, 42, 42, 691, 42, + 42, 42, 42, 42, 691, 42, 42, 42, 691, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 691, 42, 42, + + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 691, 42, 42, 42, 42, 42, 42, 691, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 691, 691, 42, 42, 42, 42, 691, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 691, 42, + 691, 42, 42, 691, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 691, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 691, 42, 691, 42, 42, 42, 42, 42, 691, 42, + + 42, 42, 42, 42, 42, 42, 691, 42, 42, 42, + 42, 691, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 691, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 691, 42, 42, 42, + 42, 691, 691, 42, 42, 691, 691, 42, 42, 42, + 42, 42, 42, 42, 42, 691, 691, 42, 691, 42, + 691, 42, 42, 42, 691, 42, 691, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 691, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 691, 42, 42, 42, 42, 691, 42, 42, 691, 691, + + 42, 42, 691, 42, 42, 42, 691, 42, 42, 42, + 42, 42, 691, 42, 42, 691, 42, 691, 691, 691, + 42, 691, 42, 691, 42, 42, 42, 691, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 691, 691, 42, + 42, 42, 42, 691, 42, 691, 691, 42, 691, 42, + 42, 691, 42, 42, 42, 42, 42, 42, 42, 691, + 42, 42, 42, 691, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 691, 42, 42, 691, 42, 42, 42, 691, + 0, 691, 691, 691, 691, 691, 691, 691, 691, 691, + + 691, 691, 691 + } ; + +static yyconst flex_uint16_t yy_nxt[1009] = + { 0, + 12, 13, 14, 13, 12, 15, 16, 12, 17, 18, + 19, 20, 21, 22, 22, 22, 23, 24, 12, 12, + 12, 12, 25, 12, 26, 12, 27, 12, 12, 12, + 12, 12, 25, 28, 12, 12, 12, 12, 12, 12, + 29, 12, 12, 12, 12, 30, 12, 12, 12, 12, + 12, 31, 32, 34, 14, 34, 34, 14, 34, 35, + 38, 37, 35, 12, 12, 37, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 38, 12, 69, 39, + 12, 39, 12, 70, 12, 112, 68, 68, 68, 113, + 12, 12, 12, 12, 36, 66, 12, 39, 12, 39, + + 39, 670, 39, 12, 117, 66, 149, 150, 118, 12, + 12, 41, 41, 41, 42, 42, 43, 42, 42, 42, + 42, 42, 42, 42, 42, 44, 42, 42, 42, 42, + 42, 42, 45, 42, 46, 42, 47, 42, 42, 48, + 42, 49, 50, 51, 42, 42, 52, 53, 42, 54, + 42, 55, 56, 57, 58, 59, 60, 61, 62, 42, + 42, 42, 42, 42, 64, 671, 65, 65, 65, 64, + 99, 67, 67, 67, 82, 66, 72, 82, 72, 100, + 66, 73, 73, 73, 64, 66, 67, 67, 67, 672, + 66, 91, 104, 92, 83, 66, 93, 83, 114, 94, + + 95, 105, 115, 106, 96, 66, 42, 97, 123, 673, + 101, 116, 124, 42, 102, 42, 153, 103, 98, 160, + 42, 127, 42, 42, 42, 128, 125, 42, 42, 674, + 42, 154, 42, 42, 42, 42, 42, 42, 42, 42, + 88, 107, 108, 119, 675, 109, 161, 42, 156, 145, + 110, 157, 120, 121, 68, 68, 68, 122, 146, 676, + 42, 171, 172, 66, 42, 72, 254, 72, 42, 677, + 73, 73, 73, 66, 255, 42, 678, 679, 42, 182, + 42, 89, 64, 183, 65, 65, 65, 64, 270, 67, + 67, 67, 271, 66, 597, 68, 68, 68, 66, 73, + + 73, 73, 296, 66, 66, 73, 73, 73, 66, 176, + 177, 178, 680, 681, 66, 141, 141, 141, 412, 179, + 398, 180, 141, 141, 141, 181, 682, 413, 598, 683, + 141, 141, 141, 141, 141, 141, 201, 201, 201, 256, + 257, 297, 399, 201, 201, 201, 258, 684, 685, 686, + 687, 201, 201, 201, 201, 201, 201, 260, 260, 260, + 603, 688, 277, 421, 260, 260, 260, 278, 689, 422, + 690, 669, 260, 260, 260, 260, 260, 260, 457, 668, + 487, 559, 667, 458, 488, 522, 560, 604, 666, 665, + 523, 664, 663, 662, 661, 660, 659, 279, 658, 657, + + 656, 280, 42, 42, 42, 655, 654, 653, 652, 42, + 42, 42, 651, 650, 649, 648, 647, 42, 42, 42, + 42, 42, 42, 646, 524, 33, 33, 33, 33, 33, + 33, 33, 63, 645, 63, 63, 63, 63, 63, 79, + 644, 79, 643, 79, 79, 79, 81, 81, 81, 81, + 81, 81, 81, 87, 87, 87, 87, 87, 87, 87, + 129, 642, 129, 129, 129, 129, 129, 81, 81, 641, + 81, 139, 139, 139, 139, 139, 197, 197, 253, 253, + 317, 317, 81, 81, 640, 639, 638, 637, 636, 635, + 634, 633, 632, 631, 630, 629, 628, 627, 626, 625, + + 624, 623, 622, 621, 620, 619, 618, 617, 616, 615, + 614, 613, 612, 611, 610, 609, 608, 607, 606, 605, + 602, 601, 600, 599, 596, 595, 594, 593, 592, 591, + 590, 589, 588, 587, 586, 585, 584, 583, 582, 581, + 580, 579, 578, 577, 576, 575, 574, 573, 572, 571, + 570, 569, 568, 567, 566, 565, 564, 563, 562, 561, + 558, 557, 556, 555, 554, 553, 552, 551, 550, 549, + 548, 547, 546, 545, 544, 543, 542, 541, 540, 539, + 538, 537, 536, 535, 534, 533, 532, 531, 530, 529, + 528, 527, 526, 525, 521, 520, 519, 518, 517, 516, + + 515, 514, 513, 512, 511, 510, 509, 508, 507, 506, + 505, 504, 503, 502, 501, 500, 499, 498, 497, 496, + 495, 494, 493, 492, 491, 490, 489, 486, 485, 484, + 483, 482, 481, 480, 479, 478, 477, 476, 475, 474, + 473, 472, 471, 470, 469, 468, 467, 466, 465, 464, + 463, 462, 461, 460, 459, 456, 455, 454, 453, 452, + 451, 450, 449, 448, 447, 446, 445, 444, 443, 442, + 441, 440, 439, 438, 437, 436, 435, 434, 433, 432, + 431, 430, 429, 428, 427, 426, 425, 424, 423, 420, + 419, 418, 417, 416, 415, 414, 411, 410, 409, 408, + + 407, 406, 405, 404, 403, 402, 401, 400, 397, 396, + 395, 394, 393, 392, 391, 390, 389, 388, 387, 386, + 385, 384, 383, 382, 381, 380, 379, 378, 377, 376, + 375, 374, 373, 372, 371, 370, 369, 368, 367, 366, + 365, 364, 363, 362, 361, 360, 359, 358, 357, 356, + 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, + 345, 344, 343, 342, 341, 340, 339, 338, 337, 336, + 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, + 325, 324, 323, 322, 321, 320, 319, 318, 316, 315, + 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, + + 304, 303, 302, 301, 300, 299, 298, 295, 294, 293, + 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, + 282, 281, 276, 275, 274, 273, 272, 269, 268, 267, + 266, 265, 264, 263, 262, 261, 259, 252, 195, 251, + 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, + 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, + 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, + 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, + 210, 209, 208, 207, 206, 205, 204, 203, 202, 140, + 200, 199, 198, 196, 195, 194, 193, 192, 191, 190, + + 189, 188, 187, 186, 185, 184, 175, 174, 173, 170, + 169, 168, 167, 166, 165, 164, 163, 162, 159, 158, + 155, 152, 151, 148, 147, 144, 143, 142, 140, 138, + 137, 136, 135, 134, 133, 132, 131, 130, 126, 111, + 90, 86, 85, 84, 40, 80, 78, 77, 76, 75, + 74, 71, 40, 691, 11, 691, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, + + 691, 691, 691, 691, 691, 691, 691, 691 + } ; + +static yyconst flex_int16_t yy_chk[1009] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 3, 3, 4, 4, 4, 3, + 9, 7, 4, 5, 5, 8, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 10, 9, 21, 13, + 5, 13, 5, 21, 5, 56, 20, 20, 20, 56, + 5, 5, 7, 10, 5, 20, 8, 34, 5, 34, + + 39, 667, 39, 5, 58, 20, 96, 96, 58, 5, + 5, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 17, 668, 17, 17, 17, 19, + 51, 19, 19, 19, 41, 17, 25, 81, 25, 51, + 19, 25, 25, 25, 22, 17, 22, 22, 22, 669, + 19, 49, 53, 49, 41, 22, 49, 81, 57, 49, + + 50, 53, 57, 53, 50, 22, 42, 50, 60, 670, + 52, 57, 60, 42, 52, 42, 99, 52, 50, 104, + 42, 62, 42, 42, 42, 62, 60, 42, 42, 671, + 42, 99, 42, 42, 42, 42, 42, 42, 42, 42, + 47, 54, 54, 59, 672, 54, 104, 47, 101, 93, + 54, 101, 59, 59, 64, 64, 64, 59, 93, 673, + 47, 114, 114, 64, 47, 66, 198, 66, 47, 674, + 66, 66, 66, 64, 198, 47, 675, 676, 47, 119, + 47, 47, 65, 119, 65, 65, 65, 67, 211, 67, + 67, 67, 211, 65, 572, 68, 68, 68, 67, 72, + + 72, 72, 233, 65, 68, 73, 73, 73, 67, 118, + 118, 118, 677, 678, 68, 89, 89, 89, 366, 118, + 350, 118, 89, 89, 89, 118, 679, 366, 572, 680, + 89, 89, 89, 89, 89, 89, 141, 141, 141, 199, + 199, 233, 350, 141, 141, 141, 199, 681, 682, 684, + 685, 141, 141, 141, 141, 141, 141, 201, 201, 201, + 577, 687, 217, 375, 201, 201, 201, 217, 688, 375, + 689, 666, 201, 201, 201, 201, 201, 201, 411, 665, + 444, 524, 663, 411, 444, 483, 524, 577, 662, 661, + 483, 659, 658, 657, 656, 655, 654, 217, 653, 651, + + 650, 217, 260, 260, 260, 648, 645, 643, 642, 260, + 260, 260, 641, 640, 637, 636, 635, 260, 260, 260, + 260, 260, 260, 634, 483, 692, 692, 692, 692, 692, + 692, 692, 693, 633, 693, 693, 693, 693, 693, 694, + 632, 694, 631, 694, 694, 694, 695, 695, 695, 695, + 695, 695, 695, 696, 696, 696, 696, 696, 696, 696, + 697, 630, 697, 697, 697, 697, 697, 698, 698, 629, + 698, 699, 699, 699, 699, 699, 700, 700, 701, 701, + 702, 702, 703, 703, 627, 626, 625, 623, 621, 617, + 615, 614, 612, 611, 610, 609, 608, 606, 605, 604, + + 602, 601, 598, 597, 595, 594, 593, 592, 590, 589, + 588, 587, 586, 585, 584, 583, 582, 580, 579, 578, + 576, 575, 574, 573, 571, 570, 569, 568, 566, 564, + 563, 562, 560, 558, 555, 554, 553, 552, 551, 550, + 549, 548, 545, 544, 541, 540, 539, 538, 536, 535, + 534, 533, 532, 531, 530, 529, 528, 527, 526, 525, + 523, 521, 520, 519, 518, 517, 516, 515, 514, 513, + 511, 510, 509, 508, 506, 505, 504, 503, 502, 501, + 500, 498, 497, 496, 495, 494, 492, 490, 489, 488, + 487, 486, 485, 484, 482, 481, 480, 478, 477, 476, + + 475, 474, 473, 472, 471, 470, 469, 468, 467, 466, + 465, 463, 462, 460, 458, 457, 456, 455, 454, 453, + 452, 451, 450, 449, 447, 446, 445, 441, 440, 439, + 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, + 428, 427, 426, 425, 424, 423, 422, 421, 420, 418, + 417, 416, 415, 414, 413, 410, 409, 408, 407, 406, + 405, 404, 403, 402, 401, 400, 399, 397, 396, 395, + 394, 393, 392, 391, 390, 389, 388, 387, 386, 385, + 384, 383, 382, 381, 380, 379, 378, 377, 376, 374, + 373, 372, 371, 370, 368, 367, 364, 363, 362, 361, + + 360, 358, 357, 356, 355, 353, 352, 351, 349, 348, + 347, 346, 345, 344, 343, 342, 341, 339, 338, 337, + 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, + 326, 325, 323, 322, 319, 318, 316, 315, 314, 309, + 308, 307, 306, 305, 304, 303, 302, 301, 300, 299, + 298, 297, 295, 294, 293, 292, 291, 289, 288, 287, + 286, 285, 284, 283, 282, 281, 280, 279, 278, 276, + 275, 274, 273, 271, 270, 269, 268, 266, 265, 263, + 262, 261, 259, 258, 257, 256, 255, 254, 252, 251, + 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, + + 240, 239, 238, 237, 236, 235, 234, 232, 231, 230, + 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, + 219, 218, 216, 215, 214, 213, 212, 210, 209, 208, + 207, 206, 205, 204, 203, 202, 200, 196, 193, 192, + 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, + 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, + 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, + 161, 159, 158, 157, 156, 155, 154, 153, 152, 151, + 150, 149, 148, 147, 146, 145, 144, 143, 142, 139, + 138, 137, 136, 133, 132, 131, 130, 128, 127, 126, + + 125, 124, 123, 122, 121, 120, 117, 116, 115, 113, + 112, 111, 110, 109, 108, 107, 106, 105, 103, 102, + 100, 98, 97, 95, 94, 92, 91, 90, 87, 86, + 85, 84, 83, 79, 78, 76, 75, 74, 61, 55, + 48, 46, 45, 44, 40, 38, 36, 35, 30, 29, + 28, 24, 14, 11, 691, 691, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, + 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, + + 691, 691, 691, 691, 691, 691, 691, 691 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int parser4__flex_debug; +int parser4__flex_debug = 1; + +static yyconst flex_int16_t yy_rule_linenum[99] = + { 0, + 128, 130, 132, 137, 138, 143, 144, 145, 157, 160, + 165, 172, 181, 190, 199, 208, 217, 226, 238, 248, + 258, 268, 279, 289, 299, 309, 319, 328, 337, 346, + 360, 375, 384, 393, 402, 411, 420, 429, 438, 447, + 456, 466, 475, 484, 493, 502, 511, 520, 529, 539, + 549, 559, 568, 578, 588, 598, 608, 617, 627, 636, + 645, 654, 663, 672, 682, 692, 701, 710, 719, 728, + 737, 746, 755, 764, 773, 782, 791, 800, 809, 818, + 827, 836, 845, 855, 918, 923, 928, 933, 934, 935, + 936, 937, 938, 940, 958, 971, 976, 980 + + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *parser4_text; +#line 1 "dhcp4_lexer.ll" +/* Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC") + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#line 8 "dhcp4_lexer.ll" +#include +#include +#include +#include +#include +#include +#include +#include + +// Work around an incompatibility in flex (at least versions +// 2.5.31 through 2.5.33): it generates code that does +// not conform to C89. See Debian bug 333231 +// . +# undef parser4_wrap +# define parser4_wrap() 1 + +namespace { + +bool start_token_flag = false; + +isc::dhcp::Parser4Context::ParserType start_token_value; +unsigned int comment_start_line = 0; + +}; + +// To avoid the call to exit... oops! +#define YY_FATAL_ERROR(msg) isc::dhcp::Parser4Context::fatal(msg) +/* noyywrap disables automatic rewinding for the next file to parse. Since we + always parse only a single string, there's no need to do any wraps. And + using parser4_wrap requires linking with -lfl, which provides the default parser4_wrap + implementation that always returns 1 anyway. */ +/* nounput simplifies the lexer, by removing support for putting a character + back into the input stream. We never use such capability anyway. */ +/* batch means that we'll never use the generated lexer interactively. */ +/* avoid to get static global variables to remain with C++. */ +/* in last resort %option reentrant */ +/* Enables debug mode. To see the debug messages, one needs to also set + parser4__flex_debug to 1, then the debug messages will be printed on stderr. */ +/* I have no idea what this option does, except it was specified in the bison + examples and Postgres folks added it to remove gcc 4.3 warnings. Let's + be on the safe side and keep it. */ +#define YY_NO_INPUT 1 + + +/* These are not token expressions yet, just convenience expressions that + can be used during actual token definitions. Note some can match + incorrect inputs (e.g., IP addresses) which must be checked. */ +/* for errors */ +#line 86 "dhcp4_lexer.ll" +// This code run each time a pattern is matched. It updates the location +// by moving it ahead by parser4_leng bytes. parser4_leng specifies the length of the +// currently matched token. +#define YY_USER_ACTION driver.loc_.columns(parser4_leng); +#line 1101 "dhcp4_lexer.cc" + +#define INITIAL 0 +#define COMMENT 1 +#define DIR_ENTER 2 +#define DIR_INCLUDE 3 +#define DIR_EXIT 4 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +/* %if-c-only */ +#include +/* %endif */ +/* %if-c++-only */ +/* %endif */ +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* %if-c-only Reentrant structure and macros (non-C++). */ +/* %if-reentrant */ +/* %if-c-only */ + +static int yy_init_globals (void ); + +/* %endif */ +/* %if-reentrant */ +/* %endif */ +/* %endif End reentrant structures and macros. */ + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int parser4_lex_destroy (void ); + +int parser4_get_debug (void ); + +void parser4_set_debug (int debug_flag ); + +YY_EXTRA_TYPE parser4_get_extra (void ); + +void parser4_set_extra (YY_EXTRA_TYPE user_defined ); + +FILE *parser4_get_in (void ); + +void parser4_set_in (FILE * _in_str ); + +FILE *parser4_get_out (void ); + +void parser4_set_out (FILE * _out_str ); + +yy_size_t parser4_get_leng (void ); + +char *parser4_get_text (void ); + +int parser4_get_lineno (void ); + +void parser4_set_lineno (int _line_number ); + +/* %if-bison-bridge */ +/* %endif */ + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int parser4_wrap (void ); +#else +extern int parser4_wrap (void ); +#endif +#endif + +/* %not-for-header */ + +#ifndef YY_NO_UNPUT + +#endif +/* %ok-for-header */ + +/* %endif */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT +/* %if-c-only Standard (non-C++) definition */ +/* %not-for-header */ + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif +/* %ok-for-header */ + +/* %endif */ +#endif + +/* %if-c-only */ + +/* %endif */ + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* %if-c-only Standard (non-C++) definition */ +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( parser4_text, parser4_leng, 1, parser4_out )) {} } while (0) +/* %endif */ +/* %if-c++-only C++ definition */ +/* %endif */ +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ +/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( parser4_in )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( parser4_in ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, parser4_in))==0 && ferror(parser4_in)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(parser4_in); \ + } \ + }\ +\ +/* %if-c++-only C++ definition \ */\ +/* %endif */ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +/* %if-c-only */ +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +#endif + +/* %if-tables-serialization structures and prototypes */ +/* %not-for-header */ + +/* %ok-for-header */ + +/* %not-for-header */ + +/* %tables-yydmap generated elements */ +/* %endif */ +/* end tables serialization structures and prototypes */ + +/* %ok-for-header */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 +/* %if-c-only Standard (non-C++) definition */ + +extern int parser4_lex (void); + +#define YY_DECL int parser4_lex (void) +/* %endif */ +/* %if-c++-only C++ definition */ +/* %endif */ +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after parser4_text and parser4_leng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +/* %% [6.0] YY_RULE_SETUP definition goes here */ +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/* %not-for-header */ + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! parser4_in ) +/* %if-c-only */ + parser4_in = stdin; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + + if ( ! parser4_out ) +/* %if-c-only */ + parser4_out = stdout; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + + if ( ! YY_CURRENT_BUFFER ) { + parser4_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + parser4__create_buffer(parser4_in,YY_BUF_SIZE ); + } + + parser4__load_buffer_state( ); + } + + { +/* %% [7.0] user's declarations go here */ +#line 92 "dhcp4_lexer.ll" + + + + // This part of the code is copied over to the verbatim to the top + // of the generated parser4_lex function. Explanation: + // http://www.gnu.org/software/bison/manual/html_node/Multiple-start_002dsymbols.html + + // Code run each time parser4_lex is called. + driver.loc_.step(); + + if (start_token_flag) { + start_token_flag = false; + switch (start_token_value) { + case Parser4Context::PARSER_JSON: + default: + return isc::dhcp::Dhcp4Parser::make_TOPLEVEL_JSON(driver.loc_); + case Parser4Context::PARSER_DHCP4: + return isc::dhcp::Dhcp4Parser::make_TOPLEVEL_DHCP4(driver.loc_); + case Parser4Context::SUBPARSER_DHCP4: + return isc::dhcp::Dhcp4Parser::make_SUB_DHCP4(driver.loc_); + case Parser4Context::PARSER_INTERFACES: + return isc::dhcp::Dhcp4Parser::make_SUB_INTERFACES4(driver.loc_); + case Parser4Context::PARSER_SUBNET4: + return isc::dhcp::Dhcp4Parser::make_SUB_SUBNET4(driver.loc_); + case Parser4Context::PARSER_POOL4: + return isc::dhcp::Dhcp4Parser::make_SUB_POOL4(driver.loc_); + case Parser4Context::PARSER_HOST_RESERVATION: + return isc::dhcp::Dhcp4Parser::make_SUB_RESERVATION(driver.loc_); + case Parser4Context::PARSER_OPTION_DATA: + return isc::dhcp::Dhcp4Parser::make_SUB_OPTION_DATA(driver.loc_); + case Parser4Context::PARSER_HOOKS_LIBRARY: + return isc::dhcp::Dhcp4Parser::make_SUB_HOOKS_LIBRARY(driver.loc_); + } + } + + +#line 1425 "dhcp4_lexer.cc" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { +/* %% [8.0] yymore()-related code goes here */ + yy_cp = (yy_c_buf_p); + + /* Support of parser4_text. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + +/* %% [9.0] code to set up and find next match goes here */ + yy_current_state = (yy_start); +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 692 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_current_state != 691 ); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + +yy_find_action: +/* %% [10.0] code to find the action number goes here */ + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +/* %% [11.0] code for parser4_lineno update goes here */ + +do_action: /* This label is used only to access EOF actions. */ + +/* %% [12.0] debug code goes here */ + if ( parser4__flex_debug ) + { + if ( yy_act == 0 ) + fprintf( stderr, "--scanner backing up\n" ); + else if ( yy_act < 99 ) + fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", + (long)yy_rule_linenum[yy_act], parser4_text ); + else if ( yy_act == 99 ) + fprintf( stderr, "--accepting default rule (\"%s\")\n", + parser4_text ); + else if ( yy_act == 100 ) + fprintf( stderr, "--(end of buffer or a NUL)\n" ); + else + fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); + } + + switch ( yy_act ) + { /* beginning of action switch */ +/* %% [13.0] actions go here */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 128 "dhcp4_lexer.ll" +; + YY_BREAK +case 2: +YY_RULE_SETUP +#line 130 "dhcp4_lexer.ll" +; + YY_BREAK +case 3: +YY_RULE_SETUP +#line 132 "dhcp4_lexer.ll" +{ + BEGIN(COMMENT); + comment_start_line = driver.loc_.end.line;; +} + YY_BREAK +case 4: +YY_RULE_SETUP +#line 137 "dhcp4_lexer.ll" +BEGIN(INITIAL); + YY_BREAK +case 5: +YY_RULE_SETUP +#line 138 "dhcp4_lexer.ll" +; + YY_BREAK +case YY_STATE_EOF(COMMENT): +#line 139 "dhcp4_lexer.ll" +{ + isc_throw(Dhcp4ParseError, "Comment not closed. (/* in line " << comment_start_line); +} + YY_BREAK +case 6: +YY_RULE_SETUP +#line 143 "dhcp4_lexer.ll" +BEGIN(DIR_ENTER); + YY_BREAK +case 7: +YY_RULE_SETUP +#line 144 "dhcp4_lexer.ll" +BEGIN(DIR_INCLUDE); + YY_BREAK +case 8: +YY_RULE_SETUP +#line 145 "dhcp4_lexer.ll" +{ + // Include directive. + + // Extract the filename. + std::string tmp(parser4_text+1); + tmp.resize(tmp.size() - 1); + + driver.includeFile(tmp); +} + YY_BREAK +case YY_STATE_EOF(DIR_ENTER): +case YY_STATE_EOF(DIR_INCLUDE): +case YY_STATE_EOF(DIR_EXIT): +#line 154 "dhcp4_lexer.ll" +{ + isc_throw(Dhcp4ParseError, "Directive not closed."); +} + YY_BREAK +case 9: +YY_RULE_SETUP +#line 157 "dhcp4_lexer.ll" +BEGIN(INITIAL); + YY_BREAK +case 10: +YY_RULE_SETUP +#line 160 "dhcp4_lexer.ll" +{ + // Ok, we found a with space. Let's ignore it and update loc variable. + driver.loc_.step(); +} + YY_BREAK +case 11: +/* rule 11 can match eol */ +YY_RULE_SETUP +#line 165 "dhcp4_lexer.ll" +{ + // Newline found. Let's update the location and continue. + driver.loc_.lines(parser4_leng); + driver.loc_.step(); +} + YY_BREAK +case 12: +YY_RULE_SETUP +#line 172 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::CONFIG: + return isc::dhcp::Dhcp4Parser::make_DHCP6(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("Dhcp6", driver.loc_); + } +} + YY_BREAK +case 13: +YY_RULE_SETUP +#line 181 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_INTERFACES_CONFIG(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("interfaces-config", driver.loc_); + } +} + YY_BREAK +case 14: +YY_RULE_SETUP +#line 190 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::INTERFACES_CONFIG: + return isc::dhcp::Dhcp4Parser::make_INTERFACES(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("interfaces", driver.loc_); + } +} + YY_BREAK +case 15: +YY_RULE_SETUP +#line 199 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_LEASE_DATABASE(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("lease-database", driver.loc_); + } +} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 208 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_HOSTS_DATABASE(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("hosts-database", driver.loc_); + } +} + YY_BREAK +case 17: +YY_RULE_SETUP +#line 217 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::HOSTS_DATABASE: + return isc::dhcp::Dhcp4Parser::make_READONLY(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("readonly", driver.loc_); + } +} + YY_BREAK +case 18: +YY_RULE_SETUP +#line 226 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::LEASE_DATABASE: + case isc::dhcp::Parser4Context::HOSTS_DATABASE: + case isc::dhcp::Parser4Context::OPTION_DEF: + case isc::dhcp::Parser4Context::SERVER_ID: + return isc::dhcp::Dhcp4Parser::make_TYPE(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("type", driver.loc_); + } +} + YY_BREAK +case 19: +YY_RULE_SETUP +#line 238 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::LEASE_DATABASE: + case isc::dhcp::Parser4Context::HOSTS_DATABASE: + return isc::dhcp::Dhcp4Parser::make_USER(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("user", driver.loc_); + } +} + YY_BREAK +case 20: +YY_RULE_SETUP +#line 248 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::LEASE_DATABASE: + case isc::dhcp::Parser4Context::HOSTS_DATABASE: + return isc::dhcp::Dhcp4Parser::make_PASSWORD(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("password", driver.loc_); + } +} + YY_BREAK +case 21: +YY_RULE_SETUP +#line 258 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::LEASE_DATABASE: + case isc::dhcp::Parser4Context::HOSTS_DATABASE: + return isc::dhcp::Dhcp4Parser::make_HOST(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("host", driver.loc_); + } +} + YY_BREAK +case 22: +YY_RULE_SETUP +#line 268 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::LEASE_DATABASE: + case isc::dhcp::Parser4Context::HOSTS_DATABASE: + case isc::dhcp::Parser4Context::SERVER_ID: + return isc::dhcp::Dhcp4Parser::make_PERSIST(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("persist", driver.loc_); + } +} + YY_BREAK +case 23: +YY_RULE_SETUP +#line 279 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::LEASE_DATABASE: + case isc::dhcp::Parser4Context::HOSTS_DATABASE: + return isc::dhcp::Dhcp4Parser::make_LFC_INTERVAL(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("lfc-interval", driver.loc_); + } +} + YY_BREAK +case 24: +YY_RULE_SETUP +#line 289 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_VALID_LIFETIME(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("valid-lifetime", driver.loc_); + } +} + YY_BREAK +case 25: +YY_RULE_SETUP +#line 299 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_RENEW_TIMER(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("renew-timer", driver.loc_); + } +} + YY_BREAK +case 26: +YY_RULE_SETUP +#line 309 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_REBIND_TIMER(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("rebind-timer", driver.loc_); + } +} + YY_BREAK +case 27: +YY_RULE_SETUP +#line 319 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_DECLINE_PROBATION_PERIOD(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("decline-probation-period", driver.loc_); + } +} + YY_BREAK +case 28: +YY_RULE_SETUP +#line 328 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_SUBNET4(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("subnet4", driver.loc_); + } +} + YY_BREAK +case 29: +YY_RULE_SETUP +#line 337 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_OPTION_DEF(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("option-def", driver.loc_); + } +} + YY_BREAK +case 30: +YY_RULE_SETUP +#line 346 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + case isc::dhcp::Parser4Context::SUBNET4: + case isc::dhcp::Parser4Context::POOLS: + case isc::dhcp::Parser4Context::RESERVATIONS: + case isc::dhcp::Parser4Context::CLIENT_CLASSES: + case isc::dhcp::Parser4Context::CLIENT_CLASS: + return isc::dhcp::Dhcp4Parser::make_OPTION_DATA(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("option-data", driver.loc_); + } +} + YY_BREAK +case 31: +YY_RULE_SETUP +#line 360 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::LEASE_DATABASE: + case isc::dhcp::Parser4Context::HOSTS_DATABASE: + case isc::dhcp::Parser4Context::OPTION_DEF: + case isc::dhcp::Parser4Context::OPTION_DATA: + case isc::dhcp::Parser4Context::CLIENT_CLASSES: + case isc::dhcp::Parser4Context::CLIENT_CLASS: + case isc::dhcp::Parser4Context::LOGGERS: + return isc::dhcp::Dhcp4Parser::make_NAME(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("name", driver.loc_); + } +} + YY_BREAK +case 32: +YY_RULE_SETUP +#line 375 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::OPTION_DATA: + return isc::dhcp::Dhcp4Parser::make_DATA(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("data", driver.loc_); + } +} + YY_BREAK +case 33: +YY_RULE_SETUP +#line 384 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_POOLS(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("pools", driver.loc_); + } +} + YY_BREAK +case 34: +YY_RULE_SETUP +#line 393 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::POOLS: + return isc::dhcp::Dhcp4Parser::make_POOL(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("pool", driver.loc_); + } +} + YY_BREAK +case 35: +YY_RULE_SETUP +#line 402 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_SUBNET(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("subnet", driver.loc_); + } +} + YY_BREAK +case 36: +YY_RULE_SETUP +#line 411 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_INTERFACE(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("interface", driver.loc_); + } +} + YY_BREAK +case 37: +YY_RULE_SETUP +#line 420 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_INTERFACE_ID(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("interface-id", driver.loc_); + } +} + YY_BREAK +case 38: +YY_RULE_SETUP +#line 429 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_ID(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("id", driver.loc_); + } +} + YY_BREAK +case 39: +YY_RULE_SETUP +#line 438 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_RAPID_COMMIT(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("rapid-commit", driver.loc_); + } +} + YY_BREAK +case 40: +YY_RULE_SETUP +#line 447 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_RESERVATION_MODE(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("reservation-mode", driver.loc_); + } +} + YY_BREAK +case 41: +YY_RULE_SETUP +#line 456 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::OPTION_DEF: + case isc::dhcp::Parser4Context::OPTION_DATA: + return isc::dhcp::Dhcp4Parser::make_CODE(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("code", driver.loc_); + } +} + YY_BREAK +case 42: +YY_RULE_SETUP +#line 466 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_HOST_RESERVATION_IDENTIFIERS(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("host-reservation-identifiers", driver.loc_); + } +} + YY_BREAK +case 43: +YY_RULE_SETUP +#line 475 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::CONFIG: + return isc::dhcp::Dhcp4Parser::make_LOGGING(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("Logging", driver.loc_); + } +} + YY_BREAK +case 44: +YY_RULE_SETUP +#line 484 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::LOGGING: + return isc::dhcp::Dhcp4Parser::make_LOGGERS(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("loggers", driver.loc_); + } +} + YY_BREAK +case 45: +YY_RULE_SETUP +#line 493 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::LOGGERS: + return isc::dhcp::Dhcp4Parser::make_OUTPUT_OPTIONS(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("output_options", driver.loc_); + } +} + YY_BREAK +case 46: +YY_RULE_SETUP +#line 502 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::OUTPUT_OPTIONS: + return isc::dhcp::Dhcp4Parser::make_OUTPUT(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("output", driver.loc_); + } +} + YY_BREAK +case 47: +YY_RULE_SETUP +#line 511 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::LOGGERS: + return isc::dhcp::Dhcp4Parser::make_DEBUGLEVEL(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("debuglevel", driver.loc_); + } +} + YY_BREAK +case 48: +YY_RULE_SETUP +#line 520 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::LOGGERS: + return isc::dhcp::Dhcp4Parser::make_SEVERITY(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("severity", driver.loc_); + } +} + YY_BREAK +case 49: +YY_RULE_SETUP +#line 529 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + case isc::dhcp::Parser4Context::RESERVATIONS: + return isc::dhcp::Dhcp4Parser::make_CLIENT_CLASSES(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("client-classes", driver.loc_); + } +} + YY_BREAK +case 50: +YY_RULE_SETUP +#line 539 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SUBNET4: + case isc::dhcp::Parser4Context::CLIENT_CLASSES: + return isc::dhcp::Dhcp4Parser::make_CLIENT_CLASS(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("client-class", driver.loc_); + } +} + YY_BREAK +case 51: +YY_RULE_SETUP +#line 549 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::CLIENT_CLASSES: + case isc::dhcp::Parser4Context::CLIENT_CLASS: + return isc::dhcp::Dhcp4Parser::make_TEST(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("test", driver.loc_); + } +} + YY_BREAK +case 52: +YY_RULE_SETUP +#line 559 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_RESERVATIONS(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("reservations", driver.loc_); + } +} + YY_BREAK +case 53: +YY_RULE_SETUP +#line 568 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::HOST_RESERVATION_IDENTIFIERS: + case isc::dhcp::Parser4Context::RESERVATIONS: + return isc::dhcp::Dhcp4Parser::make_DUID(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("duid", driver.loc_); + } +} + YY_BREAK +case 54: +YY_RULE_SETUP +#line 578 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::HOST_RESERVATION_IDENTIFIERS: + case isc::dhcp::Parser4Context::RESERVATIONS: + return isc::dhcp::Dhcp4Parser::make_HW_ADDRESS(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("hw-address", driver.loc_); + } +} + YY_BREAK +case 55: +YY_RULE_SETUP +#line 588 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::HOST_RESERVATION_IDENTIFIERS: + case isc::dhcp::Parser4Context::RESERVATIONS: + return isc::dhcp::Dhcp4Parser::make_CLIENT_ID(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("client-id", driver.loc_); + } +} + YY_BREAK +case 56: +YY_RULE_SETUP +#line 598 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::HOST_RESERVATION_IDENTIFIERS: + case isc::dhcp::Parser4Context::RESERVATIONS: + return isc::dhcp::Dhcp4Parser::make_CIRCUIT_ID(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("circuit-id", driver.loc_); + } +} + YY_BREAK +case 57: +YY_RULE_SETUP +#line 608 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::RESERVATIONS: + return isc::dhcp::Dhcp4Parser::make_HOSTNAME(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("hostname", driver.loc_); + } +} + YY_BREAK +case 58: +YY_RULE_SETUP +#line 617 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::OPTION_DEF: + case isc::dhcp::Parser4Context::OPTION_DATA: + return isc::dhcp::Dhcp4Parser::make_SPACE(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("space", driver.loc_); + } +} + YY_BREAK +case 59: +YY_RULE_SETUP +#line 627 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::OPTION_DATA: + return isc::dhcp::Dhcp4Parser::make_CSV_FORMAT(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("csv-format", driver.loc_); + } +} + YY_BREAK +case 60: +YY_RULE_SETUP +#line 636 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::OPTION_DEF: + return isc::dhcp::Dhcp4Parser::make_RECORD_TYPES(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("record-types", driver.loc_); + } +} + YY_BREAK +case 61: +YY_RULE_SETUP +#line 645 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::OPTION_DEF: + return isc::dhcp::Dhcp4Parser::make_ENCAPSULATE(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("encapsulate", driver.loc_); + } +} + YY_BREAK +case 62: +YY_RULE_SETUP +#line 654 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::OPTION_DEF: + return isc::dhcp::Dhcp4Parser::make_ARRAY(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("array", driver.loc_); + } +} + YY_BREAK +case 63: +YY_RULE_SETUP +#line 663 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_RELAY(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("relay", driver.loc_); + } +} + YY_BREAK +case 64: +YY_RULE_SETUP +#line 672 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::RELAY: + case isc::dhcp::Parser4Context::RESERVATIONS: + return isc::dhcp::Dhcp4Parser::make_IP_ADDRESS(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("ip-address", driver.loc_); + } +} + YY_BREAK +case 65: +YY_RULE_SETUP +#line 682 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_HOOKS_LIBRARIES(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("hooks-libraries", driver.loc_); + } +} + YY_BREAK +case 66: +YY_RULE_SETUP +#line 692 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::HOOKS_LIBRARIES: + return isc::dhcp::Dhcp4Parser::make_PARAMETERS(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("parameters", driver.loc_); + } +} + YY_BREAK +case 67: +YY_RULE_SETUP +#line 701 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::HOOKS_LIBRARIES: + return isc::dhcp::Dhcp4Parser::make_LIBRARY(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("library", driver.loc_); + } +} + YY_BREAK +case 68: +YY_RULE_SETUP +#line 710 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_SERVER_ID(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("server-id", driver.loc_); + } +} + YY_BREAK +case 69: +YY_RULE_SETUP +#line 719 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SERVER_ID: + return isc::dhcp::Dhcp4Parser::make_IDENTIFIER(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("identifier", driver.loc_); + } +} + YY_BREAK +case 70: +YY_RULE_SETUP +#line 728 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SERVER_ID: + return isc::dhcp::Dhcp4Parser::make_HTYPE(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("htype", driver.loc_); + } +} + YY_BREAK +case 71: +YY_RULE_SETUP +#line 737 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SERVER_ID: + return isc::dhcp::Dhcp4Parser::make_TIME(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("time", driver.loc_); + } +} + YY_BREAK +case 72: +YY_RULE_SETUP +#line 746 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SERVER_ID: + return isc::dhcp::Dhcp4Parser::make_ENTERPRISE_ID(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("enterprise-id", driver.loc_); + } +} + YY_BREAK +case 73: +YY_RULE_SETUP +#line 755 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_EXPIRED_LEASES_PROCESSING(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("expired-leases-processing", driver.loc_); + } +} + YY_BREAK +case 74: +YY_RULE_SETUP +#line 764 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_DHCP4O6_PORT(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("dhcp4o6-port", driver.loc_); + } +} + YY_BREAK +case 75: +YY_RULE_SETUP +#line 773 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_VERSION(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("version", driver.loc_); + } +} + YY_BREAK +case 76: +YY_RULE_SETUP +#line 782 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_CONTROL_SOCKET(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("control-socket", driver.loc_); + } +} + YY_BREAK +case 77: +YY_RULE_SETUP +#line 791 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::CONTROL_SOCKET: + return isc::dhcp::Dhcp4Parser::make_SOCKET_TYPE(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("socket-type", driver.loc_); + } +} + YY_BREAK +case 78: +YY_RULE_SETUP +#line 800 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::CONTROL_SOCKET: + return isc::dhcp::Dhcp4Parser::make_SOCKET_NAME(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("socket-name", driver.loc_); + } +} + YY_BREAK +case 79: +YY_RULE_SETUP +#line 809 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + return isc::dhcp::Dhcp4Parser::make_DHCP_DDNS(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("dhcp-ddns", driver.loc_); + } +} + YY_BREAK +case 80: +YY_RULE_SETUP +#line 818 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::CONFIG: + return isc::dhcp::Dhcp4Parser::make_DHCP4(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("Dhcp4", driver.loc_); + } +} + YY_BREAK +case 81: +YY_RULE_SETUP +#line 827 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::CONFIG: + return isc::dhcp::Dhcp4Parser::make_DHCPDDNS(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("DhcpDdns", driver.loc_); + } +} + YY_BREAK +case 82: +YY_RULE_SETUP +#line 836 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_SUBNET_4O6_INTERFACE(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("4o6-interface", driver.loc_); + } +} + YY_BREAK +case 83: +YY_RULE_SETUP +#line 845 "dhcp4_lexer.ll" +{ + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::SUBNET4: + return isc::dhcp::Dhcp4Parser::make_SUBNET_4O6_SUBNET(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("4o6-interface", driver.loc_); + } +} + YY_BREAK +case 84: +YY_RULE_SETUP +#line 855 "dhcp4_lexer.ll" +{ + // A string has been matched. It contains the actual string and single quotes. + // We need to get those quotes out of the way and just use its content, e.g. + // for 'foo' we should get foo + std::string raw(parser4_text+1); + size_t len = raw.size() - 1; + raw.resize(len); + std::string decoded; + decoded.reserve(len); + for (size_t pos = 0; pos < len; ++pos) { + char c = raw[pos]; + switch (c) { + case '"': + // impossible condition + driver.error(driver.loc_, "Bad quote in \"" + raw + "\""); + case '\\': + ++pos; + if (pos >= len) { + // impossible condition + driver.error(driver.loc_, "Overflow escape in \"" + raw + "\""); + } + c = raw[pos]; + switch (c) { + case '"': + case '\\': + case '/': + decoded.push_back(c); + break; + case 'b': + decoded.push_back('\b'); + break; + case 'f': + decoded.push_back('\f'); + break; + case 'n': + decoded.push_back('\n'); + break; + case 'r': + decoded.push_back('\r'); + break; + case 't': + decoded.push_back('\t'); + break; + case 'u': + // not yet implemented + driver.error(driver.loc_, "Unsupported unicode escape in \"" + raw + "\""); + default: + // impossible condition + driver.error(driver.loc_, "Bad escape in \"" + raw + "\""); + } + break; + default: + if ((c >= 0) && (c < 0x20)) { + // impossible condition + driver.error(driver.loc_, "Invalid control in \"" + raw + "\""); + } + decoded.push_back(c); + } + } + + return isc::dhcp::Dhcp4Parser::make_STRING(decoded, driver.loc_); +} + YY_BREAK +case 85: +/* rule 85 can match eol */ +YY_RULE_SETUP +#line 918 "dhcp4_lexer.ll" +{ + // Bad string with a forbidden control character inside + driver.error(driver.loc_, "Invalid control in " + std::string(parser4_text)); +} + YY_BREAK +case 86: +/* rule 86 can match eol */ +YY_RULE_SETUP +#line 923 "dhcp4_lexer.ll" +{ + // Bad string with a bad escape inside + driver.error(driver.loc_, "Bad escape in " + std::string(parser4_text)); +} + YY_BREAK +case 87: +YY_RULE_SETUP +#line 928 "dhcp4_lexer.ll" +{ + // Bad string with an open escape at the end + driver.error(driver.loc_, "Overflow escape in " + std::string(parser4_text)); +} + YY_BREAK +case 88: +YY_RULE_SETUP +#line 933 "dhcp4_lexer.ll" +{ return isc::dhcp::Dhcp4Parser::make_LSQUARE_BRACKET(driver.loc_); } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 934 "dhcp4_lexer.ll" +{ return isc::dhcp::Dhcp4Parser::make_RSQUARE_BRACKET(driver.loc_); } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 935 "dhcp4_lexer.ll" +{ return isc::dhcp::Dhcp4Parser::make_LCURLY_BRACKET(driver.loc_); } + YY_BREAK +case 91: +YY_RULE_SETUP +#line 936 "dhcp4_lexer.ll" +{ return isc::dhcp::Dhcp4Parser::make_RCURLY_BRACKET(driver.loc_); } + YY_BREAK +case 92: +YY_RULE_SETUP +#line 937 "dhcp4_lexer.ll" +{ return isc::dhcp::Dhcp4Parser::make_COMMA(driver.loc_); } + YY_BREAK +case 93: +YY_RULE_SETUP +#line 938 "dhcp4_lexer.ll" +{ return isc::dhcp::Dhcp4Parser::make_COLON(driver.loc_); } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 940 "dhcp4_lexer.ll" +{ + // An integer was found. + std::string tmp(parser4_text); + int64_t integer = 0; + try { + // In substring we want to use negative values (e.g. -1). + // In enterprise-id we need to use values up to 0xffffffff. + // To cover both of those use cases, we need at least + // int64_t. + integer = boost::lexical_cast(tmp); + } catch (const boost::bad_lexical_cast &) { + driver.error(driver.loc_, "Failed to convert " + tmp + " to an integer."); + } + + // The parser needs the string form as double conversion is no lossless + return isc::dhcp::Dhcp4Parser::make_INTEGER(integer, driver.loc_); +} + YY_BREAK +case 95: +YY_RULE_SETUP +#line 958 "dhcp4_lexer.ll" +{ + // A floating point was found. + std::string tmp(parser4_text); + double fp = 0.0; + try { + fp = boost::lexical_cast(tmp); + } catch (const boost::bad_lexical_cast &) { + driver.error(driver.loc_, "Failed to convert " + tmp + " to a floating point."); + } + + return isc::dhcp::Dhcp4Parser::make_FLOAT(fp, driver.loc_); +} + YY_BREAK +case 96: +YY_RULE_SETUP +#line 971 "dhcp4_lexer.ll" +{ + string tmp(parser4_text); + return isc::dhcp::Dhcp4Parser::make_BOOLEAN(tmp == "true", driver.loc_); +} + YY_BREAK +case 97: +YY_RULE_SETUP +#line 976 "dhcp4_lexer.ll" +{ + return isc::dhcp::Dhcp4Parser::make_NULL_TYPE(driver.loc_); +} + YY_BREAK +case 98: +YY_RULE_SETUP +#line 980 "dhcp4_lexer.ll" +driver.error (driver.loc_, "Invalid character: " + std::string(parser4_text)); + YY_BREAK +case YY_STATE_EOF(INITIAL): +#line 982 "dhcp4_lexer.ll" +{ + if (driver.states_.empty()) { + return isc::dhcp::Dhcp4Parser::make_END(driver.loc_); + } + driver.loc_ = driver.locs_.back(); + driver.locs_.pop_back(); + driver.file_ = driver.files_.back(); + driver.files_.pop_back(); + if (driver.sfile_) { + fclose(driver.sfile_); + driver.sfile_ = 0; + } + if (!driver.sfiles_.empty()) { + driver.sfile_ = driver.sfiles_.back(); + driver.sfiles_.pop_back(); + } + parser4__delete_buffer(YY_CURRENT_BUFFER); + parser4__switch_to_buffer(driver.states_.back()); + driver.states_.pop_back(); + + BEGIN(DIR_EXIT); +} + YY_BREAK +case 99: +YY_RULE_SETUP +#line 1005 "dhcp4_lexer.ll" +ECHO; + YY_BREAK +#line 2695 "dhcp4_lexer.cc" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed parser4_in at a new source and called + * parser4_lex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; +/* %if-c-only */ + YY_CURRENT_BUFFER_LVALUE->yy_input_file = parser4_in; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { +/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( parser4_wrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * parser4_text, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of parser4_lex */ +/* %ok-for-header */ + +/* %if-c++-only */ +/* %not-for-header */ + +/* %ok-for-header */ + +/* %endif */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +/* %if-c-only */ +static int yy_get_next_buffer (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + yy_size_t number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + yy_size_t new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + parser4_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + parser4_restart(parser4_in ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) parser4_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +/* %if-c-only */ +/* %not-for-header */ + + static yy_state_type yy_get_previous_state (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + yy_state_type yy_current_state; + char *yy_cp; + +/* %% [15.0] code to get the start state into yy_current_state goes here */ + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { +/* %% [16.0] code to find the next state goes here */ + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 692 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ +/* %if-c-only */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + int yy_is_jam; + /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ + char *yy_cp = (yy_c_buf_p); + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 692 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 691); + + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT +/* %if-c-only */ + +/* %endif */ +#endif + +/* %if-c-only */ +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + parser4_restart(parser4_in ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( parser4_wrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve parser4_text */ + (yy_hold_char) = *++(yy_c_buf_p); + +/* %% [19.0] update BOL and parser4_lineno */ + + return c; +} +/* %if-c-only */ +#endif /* ifndef YY_NO_INPUT */ +/* %endif */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ +/* %if-c-only */ + void parser4_restart (FILE * input_file ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + + if ( ! YY_CURRENT_BUFFER ){ + parser4_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + parser4__create_buffer(parser4_in,YY_BUF_SIZE ); + } + + parser4__init_buffer(YY_CURRENT_BUFFER,input_file ); + parser4__load_buffer_state( ); +} + +/* %if-c++-only */ +/* %endif */ + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ +/* %if-c-only */ + void parser4__switch_to_buffer (YY_BUFFER_STATE new_buffer ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + + /* TODO. We should be able to replace this entire function body + * with + * parser4_pop_buffer_state(); + * parser4_push_buffer_state(new_buffer); + */ + parser4_ensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + parser4__load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (parser4_wrap()) processing, but the only time this flag + * is looked at is after parser4_wrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +/* %if-c-only */ +static void parser4__load_buffer_state (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; +/* %if-c-only */ + parser4_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ +/* %if-c-only */ + YY_BUFFER_STATE parser4__create_buffer (FILE * file, int size ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) parser4_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in parser4__create_buffer()" ); + + b->yy_buf_size = (yy_size_t)size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) parser4_alloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in parser4__create_buffer()" ); + + b->yy_is_our_buffer = 1; + + parser4__init_buffer(b,file ); + + return b; +} + +/* %if-c++-only */ +/* %endif */ + +/** Destroy the buffer. + * @param b a buffer created with parser4__create_buffer() + * + */ +/* %if-c-only */ + void parser4__delete_buffer (YY_BUFFER_STATE b ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + parser4_free((void *) b->yy_ch_buf ); + + parser4_free((void *) b ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a parser4_restart() or at EOF. + */ +/* %if-c-only */ + static void parser4__init_buffer (YY_BUFFER_STATE b, FILE * file ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ + +{ + int oerrno = errno; + + parser4__flush_buffer(b ); + +/* %if-c-only */ + b->yy_input_file = file; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then parser4__init_buffer was _probably_ + * called from parser4_restart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + +/* %if-c-only */ + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + +/* %endif */ +/* %if-c++-only */ +/* %endif */ + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ +/* %if-c-only */ + void parser4__flush_buffer (YY_BUFFER_STATE b ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + parser4__load_buffer_state( ); +} + +/* %if-c-or-c++ */ +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +/* %if-c-only */ +void parser4_push_buffer_state (YY_BUFFER_STATE new_buffer ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + if (new_buffer == NULL) + return; + + parser4_ensure_buffer_stack(); + + /* This block is copied from parser4__switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from parser4__switch_to_buffer. */ + parser4__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} +/* %endif */ + +/* %if-c-or-c++ */ +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +/* %if-c-only */ +void parser4_pop_buffer_state (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + if (!YY_CURRENT_BUFFER) + return; + + parser4__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + parser4__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} +/* %endif */ + +/* %if-c-or-c++ */ +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +/* %if-c-only */ +static void parser4_ensure_buffer_stack (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + (yy_buffer_stack) = (struct yy_buffer_state**)parser4_alloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in parser4_ensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)parser4_realloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in parser4_ensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} +/* %endif */ + +/* %if-c-only */ +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE parser4__scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) parser4_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in parser4__scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + parser4__switch_to_buffer(b ); + + return b; +} +/* %endif */ + +/* %if-c-only */ +/** Setup the input buffer state to scan a string. The next call to parser4_lex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * parser4__scan_bytes() instead. + */ +YY_BUFFER_STATE parser4__scan_string (yyconst char * yystr ) +{ + + return parser4__scan_bytes(yystr,strlen(yystr) ); +} +/* %endif */ + +/* %if-c-only */ +/** Setup the input buffer state to scan the given bytes. The next call to parser4_lex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE parser4__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + yy_size_t i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) parser4_alloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in parser4__scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = parser4__scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in parser4__scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} +/* %endif */ + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +/* %if-c-only */ +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} +/* %endif */ +/* %if-c++-only */ +/* %endif */ + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up parser4_text. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + parser4_text[parser4_leng] = (yy_hold_char); \ + (yy_c_buf_p) = parser4_text + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + parser4_leng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/* %if-c-only */ +/* %if-reentrant */ +/* %endif */ + +/** Get the current line number. + * + */ +int parser4_get_lineno (void) +{ + + return parser4_lineno; +} + +/** Get the input stream. + * + */ +FILE *parser4_get_in (void) +{ + return parser4_in; +} + +/** Get the output stream. + * + */ +FILE *parser4_get_out (void) +{ + return parser4_out; +} + +/** Get the length of the current token. + * + */ +yy_size_t parser4_get_leng (void) +{ + return parser4_leng; +} + +/** Get the current token. + * + */ + +char *parser4_get_text (void) +{ + return parser4_text; +} + +/* %if-reentrant */ +/* %endif */ + +/** Set the current line number. + * @param _line_number line number + * + */ +void parser4_set_lineno (int _line_number ) +{ + + parser4_lineno = _line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * + * @see parser4__switch_to_buffer + */ +void parser4_set_in (FILE * _in_str ) +{ + parser4_in = _in_str ; +} + +void parser4_set_out (FILE * _out_str ) +{ + parser4_out = _out_str ; +} + +int parser4_get_debug (void) +{ + return parser4__flex_debug; +} + +void parser4_set_debug (int _bdebug ) +{ + parser4__flex_debug = _bdebug ; +} + +/* %endif */ + +/* %if-reentrant */ +/* %if-bison-bridge */ +/* %endif */ +/* %endif if-c-only */ + +/* %if-c-only */ +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from parser4_lex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + parser4_in = stdin; + parser4_out = stdout; +#else + parser4_in = (FILE *) 0; + parser4_out = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * parser4_lex_init() + */ + return 0; +} +/* %endif */ + +/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ +/* parser4_lex_destroy is for both reentrant and non-reentrant scanners. */ +int parser4_lex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + parser4__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + parser4_pop_buffer_state(); + } + + /* Destroy the stack itself. */ + parser4_free((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * parser4_lex() is called, initialization will occur. */ + yy_init_globals( ); + +/* %if-reentrant */ +/* %endif */ + return 0; +} +/* %endif */ + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *parser4_alloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *parser4_realloc (void * ptr, yy_size_t size ) +{ + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void parser4_free (void * ptr ) +{ + free( (char *) ptr ); /* see parser4_realloc() for (char *) cast */ +} + +/* %if-tables-serialization definitions */ +/* %define-yytables The name for this specific scanner's tables. */ +#define YYTABLES_NAME "yytables" +/* %endif */ + +/* %ok-for-header */ + +#line 1005 "dhcp4_lexer.ll" + + + +using namespace isc::dhcp; + +void +Parser4Context::scanStringBegin(const std::string& str, ParserType parser_type) +{ + start_token_flag = true; + start_token_value = parser_type; + + file_ = ""; + sfile_ = 0; + loc_.initialize(&file_); + parser4__flex_debug = trace_scanning_; + YY_BUFFER_STATE buffer; + buffer = parser4__scan_bytes(str.c_str(),str.size()); + if (!buffer) { + fatal("cannot scan string"); + // fatal() throws an exception so this can't be reached + } +} + +void +Parser4Context::scanFileBegin(FILE * f, + const std::string& filename, + ParserType parser_type) +{ + start_token_flag = true; + start_token_value = parser_type; + + file_ = filename; + sfile_ = f; + loc_.initialize(&file_); + parser4__flex_debug = trace_scanning_; + YY_BUFFER_STATE buffer; + + // See dhcp6_lexer.cc header for available definitions + buffer = parser4__create_buffer(f, 65536 /*buffer size*/); + if (!buffer) { + fatal("cannot scan file " + filename); + } + parser4__switch_to_buffer(buffer); +} + +void +Parser4Context::scanEnd() { + if (sfile_) + fclose(sfile_); + sfile_ = 0; + static_cast(parser4_lex_destroy()); + // Close files + while (!sfiles_.empty()) { + FILE* f = sfiles_.back(); + if (f) { + fclose(f); + } + sfiles_.pop_back(); + } + // Delete states + while (!states_.empty()) { + parser4__delete_buffer(states_.back()); + states_.pop_back(); + } +} + +void +Parser4Context::includeFile(const std::string& filename) { + if (states_.size() > 10) { + fatal("Too many nested include."); + } + + FILE* f = fopen(filename.c_str(), "r"); + if (!f) { + fatal("Can't open include file " + filename); + } + if (sfile_) { + sfiles_.push_back(sfile_); + } + sfile_ = f; + states_.push_back(YY_CURRENT_BUFFER); + YY_BUFFER_STATE buffer; + buffer = parser4__create_buffer(f, 65536 /*buffer size*/); + if (!buffer) { + fatal( "Can't scan include file " + filename); + } + parser4__switch_to_buffer(buffer); + files_.push_back(file_); + file_ = filename; + locs_.push_back(loc_); + loc_.initialize(&file_); + + BEGIN(INITIAL); +} + +namespace { +/// To avoid unused function error +class Dummy { + // cppcheck-suppress unusedPrivateFunction + void dummy() { yy_fatal_error("Fix me: how to disable its definition?"); } +}; +} + diff --git a/src/bin/dhcp4/dhcp4_parser.cc b/src/bin/dhcp4/dhcp4_parser.cc new file mode 100644 index 0000000000..e9555d0c0b --- /dev/null +++ b/src/bin/dhcp4/dhcp4_parser.cc @@ -0,0 +1,3405 @@ +// 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 . + +// 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 + +#line 59 "dhcp4_parser.cc" // lalr1.cc:413 + + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include // 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(0) +# define YY_STACK_PRINT() static_cast(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 ()) + { + case 108: // value + case 315: // version_value + value.move< ElementPtr > (that.value); + break; + + case 95: // "boolean" + value.move< bool > (that.value); + break; + + case 94: // "floating point" + value.move< double > (that.value); + break; + + case 93: // "integer" + value.move< int64_t > (that.value); + break; + + case 92: // "constant string" + 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 ()) + { + case 108: // value + case 315: // version_value + value.copy< ElementPtr > (that.value); + break; + + case 95: // "boolean" + value.copy< bool > (that.value); + break; + + case 94: // "floating point" + value.copy< double > (that.value); + break; + + case 93: // "integer" + value.copy< int64_t > (that.value); + break; + + case 92: // "constant string" + value.copy< std::string > (that.value); + break; + + default: + break; + } + + location = that.location; + return *this; + } + + + template + inline + void + Dhcp4Parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym); + } + +#if PARSER4_DEBUG + template + void + Dhcp4Parser::yy_print_ (std::ostream& yyo, + const basic_symbol& 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) + { + case 92: // "constant string" + +#line 183 "dhcp4_parser.yy" // lalr1.cc:636 + { yyoutput << yysym.value.template as< std::string > (); } +#line 354 "dhcp4_parser.cc" // lalr1.cc:636 + break; + + case 93: // "integer" + +#line 183 "dhcp4_parser.yy" // lalr1.cc:636 + { yyoutput << yysym.value.template as< int64_t > (); } +#line 361 "dhcp4_parser.cc" // lalr1.cc:636 + break; + + case 94: // "floating point" + +#line 183 "dhcp4_parser.yy" // lalr1.cc:636 + { yyoutput << yysym.value.template as< double > (); } +#line 368 "dhcp4_parser.cc" // lalr1.cc:636 + break; + + case 95: // "boolean" + +#line 183 "dhcp4_parser.yy" // lalr1.cc:636 + { yyoutput << yysym.value.template as< bool > (); } +#line 375 "dhcp4_parser.cc" // lalr1.cc:636 + break; + + case 108: // value + +#line 183 "dhcp4_parser.yy" // lalr1.cc:636 + { yyoutput << yysym.value.template as< ElementPtr > (); } +#line 382 "dhcp4_parser.cc" // lalr1.cc:636 + break; + + case 315: // version_value + +#line 183 "dhcp4_parser.yy" // lalr1.cc:636 + { yyoutput << yysym.value.template as< ElementPtr > (); } +#line 389 "dhcp4_parser.cc" // lalr1.cc:636 + 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]) + { + case 108: // value + case 315: // version_value + yylhs.value.build< ElementPtr > (); + break; + + case 95: // "boolean" + yylhs.value.build< bool > (); + break; + + case 94: // "floating point" + yylhs.value.build< double > (); + break; + + case 93: // "integer" + yylhs.value.build< int64_t > (); + break; + + case 92: // "constant string" + yylhs.value.build< std::string > (); + break; + + default: + break; + } + + + // Compute the default @$. + { + slice slice (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, slice, yylen); + } + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); + try + { + switch (yyn) + { + case 2: +#line 192 "dhcp4_parser.yy" // lalr1.cc:859 + { ctx.ctx_ = ctx.NO_KEYWORD; } +#line 630 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 4: +#line 193 "dhcp4_parser.yy" // lalr1.cc:859 + { ctx.ctx_ = ctx.CONFIG; } +#line 636 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 6: +#line 194 "dhcp4_parser.yy" // lalr1.cc:859 + { ctx.ctx_ = ctx.DHCP4; } +#line 642 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 8: +#line 195 "dhcp4_parser.yy" // lalr1.cc:859 + { ctx.ctx_ = ctx.INTERFACES_CONFIG; } +#line 648 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 10: +#line 196 "dhcp4_parser.yy" // lalr1.cc:859 + { ctx.ctx_ = ctx.SUBNET4; } +#line 654 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 12: +#line 197 "dhcp4_parser.yy" // lalr1.cc:859 + { ctx.ctx_ = ctx.POOLS; } +#line 660 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 14: +#line 198 "dhcp4_parser.yy" // lalr1.cc:859 + { ctx.ctx_ = ctx.RESERVATIONS; } +#line 666 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 16: +#line 199 "dhcp4_parser.yy" // lalr1.cc:859 + { ctx.ctx_ = ctx.OPTION_DEF; } +#line 672 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 18: +#line 200 "dhcp4_parser.yy" // lalr1.cc:859 + { ctx.ctx_ = ctx.OPTION_DATA; } +#line 678 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 20: +#line 201 "dhcp4_parser.yy" // lalr1.cc:859 + { ctx.ctx_ = ctx.HOOKS_LIBRARIES; } +#line 684 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 22: +#line 209 "dhcp4_parser.yy" // lalr1.cc:859 + { yylhs.value.as< ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); } +#line 690 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 23: +#line 210 "dhcp4_parser.yy" // lalr1.cc:859 + { yylhs.value.as< ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as< double > (), ctx.loc2pos(yystack_[0].location))); } +#line 696 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 24: +#line 211 "dhcp4_parser.yy" // lalr1.cc:859 + { yylhs.value.as< ElementPtr > () = ElementPtr(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); } +#line 702 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 25: +#line 212 "dhcp4_parser.yy" // lalr1.cc:859 + { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); } +#line 708 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 26: +#line 213 "dhcp4_parser.yy" // lalr1.cc:859 + { yylhs.value.as< ElementPtr > () = ElementPtr(new NullElement(ctx.loc2pos(yystack_[0].location))); } +#line 714 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 27: +#line 214 "dhcp4_parser.yy" // lalr1.cc:859 + { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); } +#line 720 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 28: +#line 215 "dhcp4_parser.yy" // lalr1.cc:859 + { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); } +#line 726 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 29: +#line 218 "dhcp4_parser.yy" // lalr1.cc:859 + { + // Push back the JSON value on the stack + ctx.stack_.push_back(yystack_[0].value.as< ElementPtr > ()); +} +#line 735 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 30: +#line 223 "dhcp4_parser.yy" // lalr1.cc:859 + { + // 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); +} +#line 746 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 31: +#line 228 "dhcp4_parser.yy" // lalr1.cc:859 + { + // map parsing completed. If we ever want to do any wrap up + // (maybe some sanity checking), this would be the best place + // for it. +} +#line 756 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 34: +#line 239 "dhcp4_parser.yy" // lalr1.cc:859 + { + // map containing a single entry + ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ()); + } +#line 765 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 35: +#line 243 "dhcp4_parser.yy" // lalr1.cc:859 + { + // 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 > ()); + } +#line 775 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 36: +#line 250 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.push_back(l); +} +#line 784 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 37: +#line 253 "dhcp4_parser.yy" // lalr1.cc:859 + { + // list parsing complete. Put any sanity checking here +} +#line 792 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 38: +#line 258 "dhcp4_parser.yy" // lalr1.cc:859 + { + // List parsing about to start +} +#line 800 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 39: +#line 260 "dhcp4_parser.yy" // lalr1.cc:859 + { + // list parsing complete. Put any sanity checking here + //ctx.stack_.pop_back(); +} +#line 809 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 42: +#line 269 "dhcp4_parser.yy" // lalr1.cc:859 + { + // List consisting of a single element. + ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ()); + } +#line 818 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 43: +#line 273 "dhcp4_parser.yy" // lalr1.cc:859 + { + // List ending with , and a value. + ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ()); + } +#line 827 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 44: +#line 284 "dhcp4_parser.yy" // lalr1.cc:859 + { + 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."); +} +#line 838 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 45: +#line 294 "dhcp4_parser.yy" // lalr1.cc:859 + { + // 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); +} +#line 849 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 46: +#line 299 "dhcp4_parser.yy" // lalr1.cc:859 + { + // map parsing completed. If we ever want to do any wrap up + // (maybe some sanity checking), this would be the best place + // for it. +} +#line 859 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 54: +#line 318 "dhcp4_parser.yy" // lalr1.cc:859 + { + // 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); +} +#line 872 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 55: +#line 325 "dhcp4_parser.yy" // lalr1.cc:859 + { + // map parsing completed. If we ever want to do any wrap up + // (maybe some sanity checking), this would be the best place + // for it. + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 884 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 56: +#line 335 "dhcp4_parser.yy" // lalr1.cc:859 + { + // Parse the Dhcp6 map + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.push_back(m); +} +#line 894 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 57: +#line 339 "dhcp4_parser.yy" // lalr1.cc:859 + { + // parsing completed +} +#line 902 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 80: +#line 371 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr prf(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("valid-lifetime", prf); +} +#line 911 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 81: +#line 376 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr prf(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("renew-timer", prf); +} +#line 920 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 82: +#line 381 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr prf(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("rebind-timer", prf); +} +#line 929 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 83: +#line 386 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr dpp(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("decline-probation-period", dpp); +} +#line 938 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 84: +#line 391 "dhcp4_parser.yy" // lalr1.cc:859 + { + 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); +} +#line 949 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 85: +#line 396 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 958 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 86: +#line 401 "dhcp4_parser.yy" // lalr1.cc:859 + { + // Parse the interfaces-config map + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.push_back(m); +} +#line 968 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 87: +#line 405 "dhcp4_parser.yy" // lalr1.cc:859 + { + // parsing completed +} +#line 976 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 88: +#line 409 "dhcp4_parser.yy" // lalr1.cc:859 + { + 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); +} +#line 987 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 89: +#line 414 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 996 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 90: +#line 419 "dhcp4_parser.yy" // lalr1.cc:859 + { + 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); +} +#line 1007 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 91: +#line 424 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1016 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 92: +#line 429 "dhcp4_parser.yy" // lalr1.cc:859 + { + 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); +} +#line 1027 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 93: +#line 434 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1036 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 105: +#line 454 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1044 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 106: +#line 456 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr prf(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("type", prf); + ctx.leave(); +} +#line 1054 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 107: +#line 462 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1062 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 108: +#line 464 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr user(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("user", user); + ctx.leave(); +} +#line 1072 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 109: +#line 470 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1080 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 110: +#line 472 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr pwd(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("password", pwd); + ctx.leave(); +} +#line 1090 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 111: +#line 478 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1098 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 112: +#line 480 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr h(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("host", h); + ctx.leave(); +} +#line 1108 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 113: +#line 486 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1116 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 114: +#line 488 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("name", name); + ctx.leave(); +} +#line 1126 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 115: +#line 494 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr n(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("persist", n); +} +#line 1135 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 116: +#line 499 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr n(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("lfc-interval", n); +} +#line 1144 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 117: +#line 504 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr n(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("readonly", n); +} +#line 1153 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 118: +#line 509 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr duid(new StringElement("duid", ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(duid); +} +#line 1162 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 119: +#line 514 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("host-reservation-identifiers", l); + ctx.stack_.push_back(l); + ctx.enter(ctx.HOST_RESERVATION_IDENTIFIERS); +} +#line 1173 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 120: +#line 519 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1182 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 127: +#line 534 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr hwaddr(new StringElement("hw-address", ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(hwaddr); +} +#line 1191 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 128: +#line 539 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr circuit(new StringElement("circuit-id", ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(circuit); +} +#line 1200 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 129: +#line 544 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr client(new StringElement("client-id", ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(client); +} +#line 1209 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 130: +#line 549 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("hooks-libraries", l); + ctx.stack_.push_back(l); + ctx.enter(ctx.HOOKS_LIBRARIES); +} +#line 1220 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 131: +#line 554 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1229 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 136: +#line 567 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(m); + ctx.stack_.push_back(m); +} +#line 1239 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 137: +#line 571 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); +} +#line 1247 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 138: +#line 575 "dhcp4_parser.yy" // lalr1.cc:859 + { + // Parse the hooks-libraries list entry map + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.push_back(m); +} +#line 1257 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 139: +#line 579 "dhcp4_parser.yy" // lalr1.cc:859 + { + // parsing completed +} +#line 1265 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 145: +#line 592 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1273 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 146: +#line 594 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr lib(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("library", lib); + ctx.leave(); +} +#line 1283 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 147: +#line 600 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1291 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 148: +#line 602 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.back()->set("parameters", yystack_[0].value.as< ElementPtr > ()); + ctx.leave(); +} +#line 1300 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 149: +#line 608 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("expired-leases-processing", m); + ctx.stack_.push_back(m); + ctx.enter(ctx.NO_KEYWORD); +} +#line 1311 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 150: +#line 613 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1320 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 153: +#line 625 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr value(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), value); +} +#line 1329 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 154: +#line 633 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("subnet4", l); + ctx.stack_.push_back(l); + ctx.enter(ctx.SUBNET4); +} +#line 1340 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 155: +#line 638 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1349 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 160: +#line 658 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(m); + ctx.stack_.push_back(m); +} +#line 1359 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 161: +#line 662 "dhcp4_parser.yy" // lalr1.cc:859 + { + // Once we reached this place, the subnet parsing is now complete. + // If we want to, we can implement default values here. + // In particular we can do things like this: + // if (!ctx.stack_.back()->get("interface")) { + // ctx.stack_.back()->set("interface", StringElement("loopback")); + // } + // + // We can also stack up one level (Dhcp6) and copy over whatever + // global parameters we want to: + // if (!ctx.stack_.back()->get("renew-timer")) { + // ElementPtr renew = ctx_stack_[...].get("renew-timer"); + // if (renew) { + // ctx.stack_.back()->set("renew-timer", renew); + // } + // } + ctx.stack_.pop_back(); +} +#line 1382 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 162: +#line 681 "dhcp4_parser.yy" // lalr1.cc:859 + { + // Parse the subnet6 list entry map + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.push_back(m); +} +#line 1392 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 163: +#line 685 "dhcp4_parser.yy" // lalr1.cc:859 + { + // parsing completed +} +#line 1400 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 183: +#line 714 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1408 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 184: +#line 716 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr subnet(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("subnet", subnet); + ctx.leave(); +} +#line 1418 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 185: +#line 722 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1426 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 186: +#line 724 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr iface(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("4o6-interface", iface); + ctx.leave(); +} +#line 1436 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 187: +#line 730 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1444 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 188: +#line 732 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr iface(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("4o6-subnet", iface); + ctx.leave(); +} +#line 1454 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 189: +#line 738 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1462 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 190: +#line 740 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr iface(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("interface", iface); + ctx.leave(); +} +#line 1472 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 191: +#line 746 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1480 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 192: +#line 748 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr iface(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("interface-id", iface); + ctx.leave(); +} +#line 1490 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 193: +#line 754 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.CLIENT_CLASS); +} +#line 1498 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 194: +#line 756 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr cls(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("client-class", cls); + ctx.leave(); +} +#line 1508 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 195: +#line 762 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1516 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 196: +#line 764 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr rm(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("reservation-mode", rm); + ctx.leave(); +} +#line 1526 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 197: +#line 770 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr id(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("id", id); +} +#line 1535 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 198: +#line 775 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr rc(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("rapid-commit", rc); +} +#line 1544 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 199: +#line 784 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("option-def", l); + ctx.stack_.push_back(l); + ctx.enter(ctx.OPTION_DEF); +} +#line 1555 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 200: +#line 789 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1564 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 205: +#line 806 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(m); + ctx.stack_.push_back(m); +} +#line 1574 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 206: +#line 810 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); +} +#line 1582 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 207: +#line 817 "dhcp4_parser.yy" // lalr1.cc:859 + { + // Parse the option-def list entry map + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.push_back(m); +} +#line 1592 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 208: +#line 821 "dhcp4_parser.yy" // lalr1.cc:859 + { + // parsing completed +} +#line 1600 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 222: +#line 847 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr code(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("code", code); +} +#line 1609 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 225: +#line 856 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1617 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 226: +#line 858 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr rtypes(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("record-types", rtypes); + ctx.leave(); +} +#line 1627 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 227: +#line 864 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1635 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 228: +#line 866 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr space(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("space", space); + ctx.leave(); +} +#line 1645 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 230: +#line 874 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1653 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 231: +#line 876 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr encap(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("encapsulate", encap); + ctx.leave(); +} +#line 1663 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 232: +#line 882 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr array(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("array", array); +} +#line 1672 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 233: +#line 891 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("option-data", l); + ctx.stack_.push_back(l); + ctx.enter(ctx.OPTION_DATA); +} +#line 1683 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 234: +#line 896 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1692 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 239: +#line 915 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(m); + ctx.stack_.push_back(m); +} +#line 1702 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 240: +#line 919 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); +} +#line 1710 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 241: +#line 926 "dhcp4_parser.yy" // lalr1.cc:859 + { + // Parse the option-data list entry map + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.push_back(m); +} +#line 1720 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 242: +#line 930 "dhcp4_parser.yy" // lalr1.cc:859 + { + // parsing completed +} +#line 1728 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 254: +#line 959 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1736 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 255: +#line 961 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr data(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("data", data); + ctx.leave(); +} +#line 1746 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 258: +#line 971 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr space(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("csv-format", space); +} +#line 1755 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 259: +#line 979 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("pools", l); + ctx.stack_.push_back(l); + ctx.enter(ctx.POOLS); +} +#line 1766 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 260: +#line 984 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1775 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 265: +#line 999 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(m); + ctx.stack_.push_back(m); +} +#line 1785 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 266: +#line 1003 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); +} +#line 1793 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 267: +#line 1007 "dhcp4_parser.yy" // lalr1.cc:859 + { + // Parse the pool list entry map + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.push_back(m); +} +#line 1803 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 268: +#line 1011 "dhcp4_parser.yy" // lalr1.cc:859 + { + // parsing completed +} +#line 1811 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 274: +#line 1024 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1819 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 275: +#line 1026 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr pool(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("pool", pool); + ctx.leave(); +} +#line 1829 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 276: +#line 1035 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("reservations", l); + ctx.stack_.push_back(l); + ctx.enter(ctx.RESERVATIONS); +} +#line 1840 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 277: +#line 1040 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1849 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 282: +#line 1053 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(m); + ctx.stack_.push_back(m); +} +#line 1859 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 283: +#line 1057 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); +} +#line 1867 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 284: +#line 1061 "dhcp4_parser.yy" // lalr1.cc:859 + { + // Parse the reservations list entry map + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.push_back(m); +} +#line 1877 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 285: +#line 1065 "dhcp4_parser.yy" // lalr1.cc:859 + { + // parsing completed +} +#line 1885 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 299: +#line 1089 "dhcp4_parser.yy" // lalr1.cc:859 + { +} +#line 1892 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 300: +#line 1090 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr addr(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[3].location))); + ctx.stack_.back()->set("ip-address", addr); +} +#line 1901 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 301: +#line 1095 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1909 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 302: +#line 1097 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr d(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("duid", d); + ctx.leave(); +} +#line 1919 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 303: +#line 1103 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1927 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 304: +#line 1105 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr hw(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("hw-address", hw); + ctx.leave(); +} +#line 1937 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 305: +#line 1111 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1945 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 306: +#line 1113 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr hw(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("client-id", hw); + ctx.leave(); +} +#line 1955 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 307: +#line 1119 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1963 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 308: +#line 1121 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr hw(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("circuit-id", hw); + ctx.leave(); +} +#line 1973 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 309: +#line 1128 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 1981 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 310: +#line 1130 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr host(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("hostname", host); + ctx.leave(); +} +#line 1991 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 311: +#line 1136 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr c(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("client-classes", c); + ctx.stack_.push_back(c); + ctx.enter(ctx.NO_KEYWORD); +} +#line 2002 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 312: +#line 1141 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 2011 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 313: +#line 1149 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("relay", m); + ctx.stack_.push_back(m); + ctx.enter(ctx.RELAY); +} +#line 2022 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 314: +#line 1154 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 2031 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 315: +#line 1159 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 2039 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 316: +#line 1161 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr ip(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("ip-address", ip); + ctx.leave(); +} +#line 2049 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 317: +#line 1170 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("client-classes", l); + ctx.stack_.push_back(l); + ctx.enter(ctx.CLIENT_CLASSES); +} +#line 2060 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 318: +#line 1175 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 2069 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 321: +#line 1184 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(m); + ctx.stack_.push_back(m); +} +#line 2079 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 322: +#line 1188 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); +} +#line 2087 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 332: +#line 1208 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 2095 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 333: +#line 1210 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr test(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("test", test); + ctx.leave(); +} +#line 2105 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 334: +#line 1219 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("server-id", m); + ctx.stack_.push_back(m); + ctx.enter(ctx.SERVER_ID); +} +#line 2116 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 335: +#line 1224 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 2125 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 345: +#line 1242 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr htype(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("htype", htype); +} +#line 2134 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 346: +#line 1247 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 2142 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 347: +#line 1249 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr id(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("identifier", id); + ctx.leave(); +} +#line 2152 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 348: +#line 1255 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr time(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("time", time); +} +#line 2161 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 349: +#line 1260 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr time(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("enterprise-id", time); +} +#line 2170 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 350: +#line 1267 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr time(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("dhcp4o6-port", time); +} +#line 2179 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 351: +#line 1273 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 2187 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 352: +#line 1275 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.back()->set("version", yystack_[0].value.as< ElementPtr > ()); + ctx.leave(); +} +#line 2196 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 353: +#line 1281 "dhcp4_parser.yy" // lalr1.cc:859 + { yylhs.value.as< ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); } +#line 2202 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 354: +#line 1282 "dhcp4_parser.yy" // lalr1.cc:859 + { yylhs.value.as< ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as< double > (), ctx.loc2pos(yystack_[0].location))); } +#line 2208 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 355: +#line 1283 "dhcp4_parser.yy" // lalr1.cc:859 + { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); } +#line 2214 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 356: +#line 1288 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("control-socket", m); + ctx.stack_.push_back(m); + ctx.enter(ctx.CONTROL_SOCKET); +} +#line 2225 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 357: +#line 1293 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 2234 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 362: +#line 1306 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 2242 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 363: +#line 1308 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr stype(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("socket-type", stype); + ctx.leave(); +} +#line 2252 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 364: +#line 1314 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 2260 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 365: +#line 1316 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("socket-name", name); + ctx.leave(); +} +#line 2270 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 366: +#line 1324 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("dhcp-ddns", m); + ctx.stack_.push_back(m); + ctx.enter(ctx.NO_KEYWORD); +} +#line 2281 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 367: +#line 1329 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 2290 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 368: +#line 1336 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 2298 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 369: +#line 1338 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.back()->set("Dhcp6", yystack_[0].value.as< ElementPtr > ()); + ctx.leave(); +} +#line 2307 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 370: +#line 1343 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 2315 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 371: +#line 1345 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.back()->set("DhcpDdns", yystack_[0].value.as< ElementPtr > ()); + ctx.leave(); +} +#line 2324 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 372: +#line 1355 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("Logging", m); + ctx.stack_.push_back(m); + ctx.enter(ctx.LOGGING); +} +#line 2335 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 373: +#line 1360 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 2344 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 377: +#line 1377 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("loggers", l); + ctx.stack_.push_back(l); + ctx.enter(ctx.LOGGERS); +} +#line 2355 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 378: +#line 1382 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 2364 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 381: +#line 1394 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(l); + ctx.stack_.push_back(l); +} +#line 2374 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 382: +#line 1398 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); +} +#line 2382 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 390: +#line 1413 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr dl(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("debuglevel", dl); +} +#line 2391 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 391: +#line 1417 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 2399 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 392: +#line 1419 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("severity", sev); + ctx.leave(); +} +#line 2409 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 393: +#line 1425 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("output_options", l); + ctx.stack_.push_back(l); + ctx.enter(ctx.OUTPUT_OPTIONS); +} +#line 2420 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 394: +#line 1430 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 2429 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 397: +#line 1439 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(m); + ctx.stack_.push_back(m); +} +#line 2439 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 398: +#line 1443 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.stack_.pop_back(); +} +#line 2447 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 401: +#line 1451 "dhcp4_parser.yy" // lalr1.cc:859 + { + ctx.enter(ctx.NO_KEYWORD); +} +#line 2455 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + case 402: +#line 1453 "dhcp4_parser.yy" // lalr1.cc:859 + { + ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("output", sev); + ctx.leave(); +} +#line 2465 "dhcp4_parser.cc" // lalr1.cc:859 + break; + + +#line 2469 "dhcp4_parser.cc" // lalr1.cc:859 + default: + break; + } + } + catch (const syntax_error& yyexc) + { + error (yyexc); + YYERROR; + } + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, yylhs); + } + goto yynewstate; + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + error (yyla.location, yysyntax_error_ (yystack_[0].state, yyla)); + } + + + yyerror_range[1].location = yyla.location; + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.type_get () == yyeof_) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (false) + goto yyerrorlab; + yyerror_range[1].location = yystack_[yylen - 1].location; + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + goto yyerrlab1; + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + { + stack_symbol_type error_token; + for (;;) + { + yyn = yypact_[yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += yyterror_; + if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } + + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); + + // Shift the error token. + error_token.state = yyn; + yypush_ ("Shifting", error_token); + } + goto yynewstate; + + // Accept. + yyacceptlab: + yyresult = 0; + goto yyreturn; + + // Abort. + yyabortlab: + yyresult = 1; + goto yyreturn; + + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } + catch (...) + { + YYCDEBUG << "Exception caught: cleaning lookahead and stack" + << std::endl; + // Do not try to display the values of the reclaimed symbols, + // as their printer might throw an exception. + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } + throw; + } + } + + void + Dhcp4Parser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what()); + } + + // Generate an error message. + std::string + Dhcp4Parser::yysyntax_error_ (state_type yystate, const symbol_type& yyla) const + { + // Number of reported tokens (one for the "unexpected", one per + // "expected"). + size_t yycount = 0; + // Its maximum. + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + // Arguments of yyformat. + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yyla) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yyla. (However, yyla is currently not documented for users.) + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state + merging (from LALR or IELR) and default reductions corrupt the + expected token list. However, the list is correct for + canonical LR with one exception: it will still contain any + token that will not be accepted due to an error action in a + later state. + */ + if (!yyla.empty ()) + { + int yytoken = yyla.type_get (); + yyarg[yycount++] = yytname_[yytoken]; + int yyn = yypact_[yystate]; + if (!yy_pact_value_is_default_ (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + // Stay within bounds of both yycheck and yytname. + int yychecklim = yylast_ - yyn + 1; + int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; + for (int yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ + && !yy_table_value_is_error_ (yytable_[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + break; + } + else + yyarg[yycount++] = yytname_[yyx]; + } + } + } + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + std::string yyres; + // Argument number. + size_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += yytnamerr_ (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres; + } + + + const short int Dhcp4Parser::yypact_ninf_ = -376; + + const signed char Dhcp4Parser::yytable_ninf_ = -1; + + const short int + Dhcp4Parser::yypact_[] = + { + 169, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, 29, 16, 26, 46, 57, 77, 84, 107, 113, + 120, 121, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, 16, -65, 20, 56, 43, 15, -4, 91, + 59, 132, -29, -376, 92, 127, 134, 123, 147, -376, + -376, -376, -376, 173, -376, 32, -376, -376, -376, -376, + -376, -376, -376, -376, 174, 189, 191, 199, -376, -376, + -376, -376, -376, -376, -376, -376, 207, -376, -376, -376, + -376, 114, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, 161, -376, -376, -376, -376, -376, -376, + -376, 211, 213, -376, -376, -376, -376, -376, -376, -376, + -376, 149, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, 150, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, 164, 216, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, 218, -376, -376, -376, 219, -376, -376, + -376, 212, 223, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, 226, -376, -376, -376, -376, 227, + 224, -376, -376, -376, -376, -376, -376, -376, -376, -376, + 151, -376, -376, -376, -376, 16, 16, -376, 144, 233, + 237, 238, 239, -376, 20, -376, 241, 243, 244, 156, + 170, 171, 172, 257, 258, 262, 263, 264, 265, 266, + 267, 179, 269, 270, 271, 56, -376, 272, -376, 106, + 273, 274, 275, 276, 277, 278, 190, 192, 280, 281, + 282, 284, 15, -376, 285, -4, -376, 286, 287, 288, + 289, 290, 291, 292, -376, 91, 293, 294, 206, 296, + 297, 298, 208, -376, 59, 300, 210, -376, 132, 302, + 303, 45, -376, -376, -376, 304, 305, 306, 16, 16, + -376, 307, 308, 311, -376, -376, -376, -376, 314, 315, + 316, 317, 318, 319, 320, 321, -376, 48, 322, 325, + -376, 328, -376, -376, -376, -376, 301, 331, -376, -376, + -376, 245, 246, 330, 248, 249, 250, -376, -376, 251, + 252, 341, 329, -376, 255, -376, 328, 256, 259, 260, + 261, 268, 279, -376, 283, 295, -376, 299, 309, 310, + -376, -376, 312, -376, -376, 313, 16, -376, 16, 56, + 235, -376, -376, 43, 31, 31, 342, 347, 348, 155, + 27, 349, 323, 68, -376, -376, -376, -376, 142, -65, + -376, -376, 354, -376, 106, -376, -376, 352, -376, -376, + -376, -376, -376, 355, 253, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, 153, -376, 165, -376, -376, 353, -376, -376, + -376, 359, 360, 361, -376, 167, -376, -376, -376, -376, + -376, -376, -376, -376, -376, 168, -376, 362, 363, -376, + -376, 364, 366, -376, -376, 367, 369, -376, -376, -376, + -376, -376, -376, 38, -376, -376, -376, -376, -376, 65, + -376, 368, 373, -376, 374, 176, -376, -376, 375, 376, + 377, -376, -376, -376, 178, -376, -376, -376, -376, -376, + -376, -376, 182, -376, -376, -376, 184, 16, 324, -376, + -376, 371, 379, -376, -376, 382, 380, -376, -376, 381, + -376, 386, 235, -376, -376, 388, 389, 390, 326, 327, + 332, 31, -376, -376, 15, -376, 342, 59, -376, 347, + 132, -376, 348, 155, -376, 27, -376, -29, -376, 349, + 333, 323, -376, 391, 335, 336, 337, 68, -376, 392, + 393, 142, -376, -376, 394, -376, -4, -376, 352, 91, + -376, 355, 395, -376, 398, -376, 339, 340, 343, -376, + -376, -376, -376, 186, -376, 399, -376, 400, -376, -376, + -376, 188, -376, -376, -376, 344, -376, -376, -376, -376, + 345, 346, -376, -376, 194, -376, 401, -376, 350, 378, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, 96, -376, -3, 378, -376, -376, + 402, -376, -376, -376, 196, -376, -376, -376, -376, -376, + 406, 351, 407, -3, -376, 408, -376, 356, -376, 405, + -376, -376, 110, -376, 357, 405, -376, -376, 198, -376, + -376, 410, 357, -376, 358, -376, -376 + }; + + const unsigned short int + Dhcp4Parser::yydefact_[] = + { + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 36, 30, 26, 25, 22, 23, 24, + 29, 3, 27, 28, 45, 5, 56, 7, 86, 9, + 162, 11, 267, 13, 284, 15, 207, 17, 241, 19, + 138, 21, 40, 32, 0, 0, 0, 0, 0, 286, + 209, 243, 0, 42, 0, 41, 0, 0, 33, 54, + 372, 368, 370, 0, 53, 0, 47, 49, 51, 52, + 50, 84, 90, 92, 0, 0, 0, 0, 154, 199, + 233, 119, 317, 130, 149, 334, 0, 351, 356, 366, + 79, 0, 58, 60, 61, 62, 63, 65, 66, 67, + 68, 72, 73, 64, 70, 71, 69, 74, 75, 76, + 77, 78, 88, 0, 321, 185, 187, 259, 183, 189, + 191, 0, 0, 195, 193, 276, 313, 182, 166, 167, + 168, 0, 164, 171, 180, 181, 172, 173, 176, 178, + 174, 175, 169, 170, 177, 179, 274, 273, 272, 0, + 269, 271, 311, 301, 303, 307, 305, 309, 299, 298, + 297, 0, 287, 288, 294, 290, 295, 292, 293, 296, + 291, 105, 113, 0, 227, 225, 230, 0, 220, 224, + 221, 0, 210, 211, 213, 223, 214, 215, 216, 229, + 217, 218, 219, 254, 0, 252, 253, 256, 257, 0, + 244, 245, 247, 248, 249, 250, 251, 145, 147, 142, + 0, 140, 143, 144, 37, 0, 0, 31, 0, 0, + 0, 0, 0, 44, 0, 46, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 57, 0, 87, 323, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 163, 0, 0, 268, 0, 0, 0, + 0, 0, 0, 0, 285, 0, 0, 0, 0, 0, + 0, 0, 0, 208, 0, 0, 0, 242, 0, 0, + 0, 0, 139, 43, 34, 0, 0, 0, 0, 0, + 48, 0, 0, 0, 80, 81, 82, 83, 0, 0, + 0, 0, 0, 0, 0, 0, 350, 0, 0, 0, + 59, 0, 332, 330, 331, 329, 0, 324, 325, 327, + 328, 0, 0, 0, 0, 0, 0, 197, 198, 0, + 0, 0, 0, 165, 0, 270, 0, 0, 0, 0, + 0, 0, 0, 289, 0, 0, 222, 0, 0, 0, + 232, 212, 0, 258, 246, 0, 0, 141, 0, 0, + 0, 369, 371, 0, 0, 0, 156, 201, 235, 0, + 0, 132, 0, 0, 355, 353, 354, 352, 0, 0, + 38, 89, 0, 322, 0, 186, 188, 261, 184, 190, + 192, 196, 194, 278, 0, 275, 312, 302, 304, 308, + 306, 310, 300, 106, 114, 228, 226, 231, 255, 146, + 148, 35, 0, 377, 0, 374, 376, 0, 107, 109, + 111, 0, 0, 0, 104, 0, 94, 96, 97, 98, + 99, 100, 101, 102, 103, 0, 160, 0, 157, 158, + 205, 0, 202, 203, 239, 0, 236, 237, 118, 127, + 128, 129, 123, 0, 121, 124, 125, 126, 319, 0, + 136, 0, 133, 134, 0, 0, 151, 346, 0, 0, + 0, 344, 338, 343, 0, 336, 341, 339, 340, 342, + 362, 364, 0, 358, 360, 361, 0, 40, 0, 326, + 265, 0, 262, 263, 282, 0, 279, 280, 315, 0, + 55, 0, 0, 373, 85, 0, 0, 0, 0, 0, + 0, 0, 91, 93, 0, 155, 0, 209, 200, 0, + 243, 234, 0, 0, 120, 0, 318, 0, 131, 0, + 0, 0, 150, 0, 0, 0, 0, 0, 335, 0, + 0, 0, 357, 367, 0, 333, 0, 260, 0, 286, + 277, 0, 0, 314, 0, 375, 0, 0, 0, 115, + 116, 117, 95, 0, 159, 0, 204, 0, 238, 122, + 320, 0, 135, 153, 152, 0, 345, 348, 349, 337, + 0, 0, 359, 39, 0, 264, 0, 281, 0, 0, + 108, 110, 112, 161, 206, 240, 137, 347, 363, 365, + 266, 283, 316, 381, 0, 379, 0, 0, 378, 393, + 0, 391, 389, 385, 0, 383, 387, 388, 386, 380, + 0, 0, 0, 0, 382, 0, 390, 0, 384, 0, + 392, 397, 0, 395, 0, 0, 394, 401, 0, 399, + 396, 0, 0, 398, 0, 400, 402 + }; + + const short int + Dhcp4Parser::yypgoto_[] = + { + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, 8, -376, -376, -376, -376, -32, -376, -376, + 42, -376, -90, -376, -54, -376, -376, -376, 185, -376, + -376, -376, -376, 39, 197, -56, -43, -40, -376, -376, + -376, -376, -376, 40, -376, -376, -376, -376, -376, 37, + -107, -369, -376, -376, -376, -376, -376, -376, -376, -59, + -376, -375, -376, -376, -376, -376, -376, -376, -118, -376, + -376, -376, -376, -376, -376, -376, -116, -376, -376, -376, + -108, 139, -376, -376, -376, -376, -376, -376, -376, -110, + -376, -376, -376, -376, -93, -376, -376, -376, -89, 175, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -371, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -88, -376, -376, -376, -91, -376, 159, -376, -52, -376, + -376, -376, -376, -48, -376, -376, -376, -376, -376, -47, + -376, -376, -376, -87, -376, -376, -376, -86, -376, 158, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -119, -376, -376, -376, -109, 183, -376, -376, -376, -376, + -376, -376, -112, -376, -376, -376, -106, -376, 177, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, 60, -376, -376, -376, -376, -376, -376, + -97, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -100, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -57, -376, -376, + -376, -161, -376, -376, -176, -376, -376, -376, -376, -376, + -376, -187, -376, -376, -193, -376 + }; + + const short int + Dhcp4Parser::yydefgoto_[] = + { + -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 63, 31, 32, 53, 67, 68, 33, 52, + 401, 507, 64, 65, 100, 35, 54, 75, 76, 77, + 229, 37, 55, 101, 102, 103, 104, 105, 106, 107, + 236, 39, 56, 123, 257, 108, 237, 109, 238, 445, + 446, 189, 286, 448, 525, 449, 526, 450, 527, 190, + 287, 452, 453, 454, 472, 110, 246, 473, 474, 475, + 476, 477, 111, 248, 481, 482, 483, 547, 51, 62, + 220, 221, 222, 299, 223, 300, 112, 249, 485, 486, + 113, 243, 457, 458, 459, 534, 41, 57, 141, 142, + 143, 263, 144, 260, 145, 261, 146, 264, 147, 265, + 148, 269, 149, 268, 150, 151, 114, 244, 461, 462, + 463, 537, 47, 60, 191, 192, 193, 194, 195, 196, + 197, 198, 290, 199, 289, 200, 201, 291, 202, 115, + 245, 465, 466, 467, 540, 49, 61, 209, 210, 211, + 212, 213, 295, 214, 215, 216, 153, 262, 511, 512, + 513, 566, 43, 58, 159, 160, 161, 274, 154, 270, + 515, 516, 517, 569, 45, 59, 171, 172, 173, 174, + 283, 175, 278, 176, 279, 177, 281, 178, 280, 179, + 282, 180, 277, 155, 271, 519, 572, 116, 247, 479, + 259, 336, 337, 338, 339, 340, 402, 117, 250, 494, + 495, 496, 497, 553, 498, 499, 118, 119, 252, 397, + 120, 253, 502, 503, 504, 559, 505, 560, 121, 254, + 78, 231, 79, 232, 80, 230, 434, 435, 436, 521, + 624, 625, 626, 634, 635, 636, 637, 642, 638, 640, + 652, 653, 654, 658, 659, 661 + }; + + const unsigned short int + Dhcp4Parser::yytable_[] = + { + 74, 138, 206, 137, 157, 169, 188, 205, 219, 207, + 152, 158, 170, 208, 139, 447, 447, 140, 493, 478, + 30, 23, 124, 24, 492, 25, 90, 66, 182, 22, + 69, 217, 218, 34, 124, 234, 156, 84, 85, 86, + 235, 543, 125, 126, 544, 90, 181, 438, 439, 440, + 441, 442, 443, 36, 127, 122, 128, 129, 130, 131, + 132, 133, 182, 73, 38, 134, 135, 81, 545, 82, + 83, 546, 136, 629, 181, 630, 631, 134, 84, 85, + 86, 87, 88, 181, 40, 89, 90, 441, 73, 73, + 182, 42, 183, 184, 70, 185, 186, 187, 224, 627, + 71, 72, 628, 91, 92, 217, 218, 73, 26, 27, + 28, 29, 73, 655, 44, 93, 656, 255, 94, 95, + 46, 90, 256, 73, 96, 97, 98, 48, 50, 99, + 225, 227, 487, 488, 489, 490, 90, 182, 226, 162, + 394, 395, 396, 163, 164, 165, 166, 167, 73, 168, + 228, 73, 272, 275, 301, 332, 255, 273, 276, 302, + 73, 520, 447, 182, 203, 183, 184, 204, 522, 258, + 531, 531, 284, 523, 590, 532, 533, 233, 239, 551, + 74, 557, 493, 73, 552, 561, 558, 228, 492, 272, + 562, 301, 563, 240, 613, 241, 616, 275, 73, 643, + 334, 662, 620, 242, 644, 333, 663, 468, 469, 470, + 471, 251, 335, 500, 501, 266, 138, 267, 137, 285, + 293, 157, 288, 292, 73, 152, 294, 298, 158, 139, + 296, 169, 140, 303, 304, 297, 305, 306, 170, 206, + 188, 307, 308, 309, 205, 311, 207, 312, 313, 314, + 208, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 318, 319, 315, 316, 317, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 331, 341, 342, 343, + 344, 345, 346, 347, 349, 350, 351, 348, 352, 354, + 356, 357, 358, 359, 360, 361, 362, 364, 365, 366, + 367, 368, 369, 370, 372, 373, 375, 376, 378, 403, + 433, 518, 379, 380, 383, 384, 381, 382, 385, 386, + 387, 388, 389, 390, 391, 451, 451, 392, 393, 398, + 444, 444, 399, 400, 404, 407, 414, 405, 406, 491, + 408, 409, 410, 411, 412, 334, 413, 415, 417, 456, + 333, 418, 419, 420, 460, 464, 480, 335, 508, 510, + 421, 524, 514, 528, 529, 530, 536, 506, 535, 539, + 538, 422, 542, 541, 548, 423, 549, 567, 550, 554, + 555, 556, 568, 571, 430, 623, 431, 424, 570, 573, + 574, 425, 576, 577, 578, 595, 600, 601, 416, 608, + 603, 426, 427, 609, 428, 429, 641, 614, 615, 621, + 645, 647, 651, 649, 664, 484, 565, 564, 432, 310, + 580, 579, 455, 437, 582, 589, 593, 581, 596, 597, + 598, 610, 611, 592, 657, 612, 617, 618, 619, 591, + 377, 594, 622, 584, 646, 583, 585, 353, 650, 605, + 666, 586, 330, 371, 587, 588, 374, 604, 355, 607, + 599, 602, 363, 606, 509, 575, 639, 648, 660, 665, + 0, 0, 451, 0, 0, 0, 0, 444, 138, 0, + 137, 206, 0, 188, 0, 0, 205, 152, 207, 0, + 0, 139, 208, 219, 140, 0, 0, 0, 0, 0, + 0, 0, 0, 491, 0, 0, 0, 0, 0, 0, + 0, 0, 157, 0, 0, 169, 0, 0, 0, 158, + 0, 0, 170, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 633, 0, 0, + 0, 0, 632, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 633, 0, 0, 0, 0, 632 + }; + + const short int + Dhcp4Parser::yycheck_[] = + { + 54, 57, 61, 57, 58, 59, 60, 61, 62, 61, + 57, 58, 59, 61, 57, 384, 385, 57, 393, 390, + 12, 5, 7, 7, 393, 9, 30, 92, 31, 0, + 10, 60, 61, 7, 7, 3, 40, 22, 23, 24, + 8, 3, 27, 28, 6, 30, 15, 16, 17, 18, + 19, 20, 21, 7, 39, 12, 41, 42, 43, 44, + 45, 46, 31, 92, 7, 50, 51, 11, 3, 13, + 14, 6, 57, 76, 15, 78, 79, 50, 22, 23, + 24, 25, 26, 15, 7, 29, 30, 19, 92, 92, + 31, 7, 33, 34, 74, 36, 37, 38, 6, 3, + 80, 81, 6, 47, 48, 60, 61, 92, 92, 93, + 94, 95, 92, 3, 7, 59, 6, 3, 62, 63, + 7, 30, 8, 92, 68, 69, 70, 7, 7, 73, + 3, 8, 64, 65, 66, 67, 30, 31, 4, 48, + 92, 93, 94, 52, 53, 54, 55, 56, 92, 58, + 3, 92, 3, 3, 3, 49, 3, 8, 8, 8, + 92, 8, 531, 31, 32, 33, 34, 35, 3, 8, + 3, 3, 8, 8, 545, 8, 8, 4, 4, 3, + 234, 3, 557, 92, 8, 3, 8, 3, 557, 3, + 8, 3, 8, 4, 8, 4, 8, 3, 92, 3, + 259, 3, 8, 4, 8, 259, 8, 52, 53, 54, + 55, 4, 259, 71, 72, 4, 272, 4, 272, 3, + 8, 275, 4, 4, 92, 272, 3, 3, 275, 272, + 4, 285, 272, 225, 226, 8, 92, 4, 285, 298, + 294, 4, 4, 4, 298, 4, 298, 4, 4, 93, + 298, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 4, 4, 93, 93, 93, 4, 4, 4, 4, + 4, 4, 93, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 93, 4, 4, 4, 95, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 93, + 4, 4, 4, 95, 4, 95, 4, 4, 4, 8, + 75, 58, 7, 7, 7, 7, 308, 309, 7, 5, + 5, 5, 5, 5, 5, 384, 385, 7, 7, 7, + 384, 385, 7, 5, 3, 5, 7, 92, 92, 393, + 92, 92, 92, 92, 92, 404, 5, 92, 92, 7, + 404, 92, 92, 92, 7, 7, 7, 404, 4, 7, + 92, 8, 7, 4, 4, 4, 3, 399, 6, 3, + 6, 92, 3, 6, 6, 92, 3, 6, 4, 4, + 4, 4, 3, 3, 376, 7, 378, 92, 6, 8, + 4, 92, 4, 4, 4, 4, 4, 4, 356, 4, + 6, 92, 92, 5, 92, 92, 4, 8, 8, 8, + 4, 4, 7, 5, 4, 92, 92, 507, 379, 234, + 93, 95, 385, 383, 531, 543, 93, 95, 93, 93, + 93, 92, 92, 549, 77, 92, 92, 92, 92, 547, + 301, 551, 92, 536, 93, 534, 537, 272, 92, 568, + 92, 539, 255, 294, 540, 542, 298, 566, 275, 571, + 557, 561, 285, 569, 404, 522, 627, 643, 655, 662, + -1, -1, 531, -1, -1, -1, -1, 531, 534, -1, + 534, 540, -1, 537, -1, -1, 540, 534, 540, -1, + -1, 534, 540, 547, 534, -1, -1, -1, -1, -1, + -1, -1, -1, 557, -1, -1, -1, -1, -1, -1, + -1, -1, 566, -1, -1, 569, -1, -1, -1, 566, + -1, -1, 569, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 626, -1, -1, + -1, -1, 626, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 643, -1, -1, -1, -1, 643 + }; + + const unsigned short int + Dhcp4Parser::yystos_[] = + { + 0, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 0, 5, 7, 9, 92, 93, 94, 95, + 108, 109, 110, 114, 7, 121, 7, 127, 7, 137, + 7, 192, 7, 258, 7, 270, 7, 218, 7, 241, + 7, 174, 115, 111, 122, 128, 138, 193, 259, 271, + 219, 242, 175, 108, 118, 119, 92, 112, 113, 10, + 74, 80, 81, 92, 120, 123, 124, 125, 326, 328, + 330, 11, 13, 14, 22, 23, 24, 25, 26, 29, + 30, 47, 48, 59, 62, 63, 68, 69, 70, 73, + 120, 129, 130, 131, 132, 133, 134, 135, 141, 143, + 161, 168, 182, 186, 212, 235, 293, 303, 312, 313, + 316, 324, 12, 139, 7, 27, 28, 39, 41, 42, + 43, 44, 45, 46, 50, 51, 57, 120, 131, 132, + 133, 194, 195, 196, 198, 200, 202, 204, 206, 208, + 210, 211, 235, 252, 264, 289, 40, 120, 235, 260, + 261, 262, 48, 52, 53, 54, 55, 56, 58, 120, + 235, 272, 273, 274, 275, 277, 279, 281, 283, 285, + 287, 15, 31, 33, 34, 36, 37, 38, 120, 147, + 155, 220, 221, 222, 223, 224, 225, 226, 227, 229, + 231, 232, 234, 32, 35, 120, 155, 224, 229, 243, + 244, 245, 246, 247, 249, 250, 251, 60, 61, 120, + 176, 177, 178, 180, 6, 3, 4, 8, 3, 126, + 331, 327, 329, 4, 3, 8, 136, 142, 144, 4, + 4, 4, 4, 187, 213, 236, 162, 294, 169, 183, + 304, 4, 314, 317, 325, 3, 8, 140, 8, 296, + 199, 201, 253, 197, 203, 205, 4, 4, 209, 207, + 265, 290, 3, 8, 263, 3, 8, 288, 278, 280, + 284, 282, 286, 276, 8, 3, 148, 156, 4, 230, + 228, 233, 4, 8, 3, 248, 4, 8, 3, 179, + 181, 3, 8, 108, 108, 92, 4, 4, 4, 4, + 124, 4, 4, 4, 93, 93, 93, 93, 4, 4, + 4, 4, 4, 4, 4, 4, 93, 4, 4, 4, + 130, 4, 49, 120, 155, 235, 297, 298, 299, 300, + 301, 4, 4, 4, 4, 4, 4, 93, 95, 4, + 4, 4, 4, 195, 4, 261, 4, 4, 4, 4, + 4, 4, 4, 274, 4, 4, 93, 4, 4, 4, + 95, 222, 4, 95, 245, 4, 4, 177, 4, 7, + 7, 108, 108, 7, 7, 7, 5, 5, 5, 5, + 5, 5, 7, 7, 92, 93, 94, 315, 7, 7, + 5, 116, 302, 8, 3, 92, 92, 5, 92, 92, + 92, 92, 92, 5, 7, 92, 116, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 108, 108, 129, 75, 332, 333, 334, 139, 16, 17, + 18, 19, 20, 21, 120, 145, 146, 147, 149, 151, + 153, 155, 157, 158, 159, 145, 7, 188, 189, 190, + 7, 214, 215, 216, 7, 237, 238, 239, 52, 53, + 54, 55, 160, 163, 164, 165, 166, 167, 206, 295, + 7, 170, 171, 172, 92, 184, 185, 64, 65, 66, + 67, 120, 147, 157, 305, 306, 307, 308, 310, 311, + 71, 72, 318, 319, 320, 322, 113, 117, 4, 299, + 7, 254, 255, 256, 7, 266, 267, 268, 58, 291, + 8, 335, 3, 8, 8, 150, 152, 154, 4, 4, + 4, 3, 8, 8, 191, 6, 3, 217, 6, 3, + 240, 6, 3, 3, 6, 3, 6, 173, 6, 3, + 4, 3, 8, 309, 4, 4, 4, 3, 8, 321, + 323, 3, 8, 8, 118, 92, 257, 6, 3, 269, + 6, 3, 292, 8, 4, 333, 4, 4, 4, 95, + 93, 95, 146, 194, 190, 220, 216, 243, 239, 164, + 206, 176, 172, 93, 185, 4, 93, 93, 93, 306, + 4, 4, 319, 6, 260, 256, 272, 268, 4, 5, + 92, 92, 92, 8, 8, 8, 8, 92, 92, 92, + 8, 8, 92, 7, 336, 337, 338, 3, 6, 76, + 78, 79, 120, 155, 339, 340, 341, 342, 344, 337, + 345, 4, 343, 3, 8, 4, 93, 4, 340, 5, + 92, 7, 346, 347, 348, 3, 6, 77, 349, 350, + 347, 351, 3, 8, 4, 350, 92 + }; + + const unsigned short int + Dhcp4Parser::yyr1_[] = + { + 0, 96, 98, 97, 99, 97, 100, 97, 101, 97, + 102, 97, 103, 97, 104, 97, 105, 97, 106, 97, + 107, 97, 108, 108, 108, 108, 108, 108, 108, 109, + 111, 110, 112, 112, 113, 113, 115, 114, 117, 116, + 118, 118, 119, 119, 120, 122, 121, 123, 123, 124, + 124, 124, 124, 124, 126, 125, 128, 127, 129, 129, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 131, 132, 133, 134, 136, 135, 138, 137, 140, 139, + 142, 141, 144, 143, 145, 145, 146, 146, 146, 146, + 146, 146, 146, 146, 146, 148, 147, 150, 149, 152, + 151, 154, 153, 156, 155, 157, 158, 159, 160, 162, + 161, 163, 163, 164, 164, 164, 164, 165, 166, 167, + 169, 168, 170, 170, 171, 171, 173, 172, 175, 174, + 176, 176, 176, 177, 177, 179, 178, 181, 180, 183, + 182, 184, 184, 185, 187, 186, 188, 188, 189, 189, + 191, 190, 193, 192, 194, 194, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 197, 196, 199, 198, 201, 200, 203, + 202, 205, 204, 207, 206, 209, 208, 210, 211, 213, + 212, 214, 214, 215, 215, 217, 216, 219, 218, 220, + 220, 221, 221, 222, 222, 222, 222, 222, 222, 222, + 222, 223, 224, 225, 226, 228, 227, 230, 229, 231, + 233, 232, 234, 236, 235, 237, 237, 238, 238, 240, + 239, 242, 241, 243, 243, 244, 244, 245, 245, 245, + 245, 245, 245, 246, 248, 247, 249, 250, 251, 253, + 252, 254, 254, 255, 255, 257, 256, 259, 258, 260, + 260, 261, 261, 261, 263, 262, 265, 264, 266, 266, + 267, 267, 269, 268, 271, 270, 272, 272, 273, 273, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 276, + 275, 278, 277, 280, 279, 282, 281, 284, 283, 286, + 285, 288, 287, 290, 289, 292, 291, 294, 293, 295, + 295, 296, 206, 297, 297, 298, 298, 299, 299, 299, + 299, 300, 302, 301, 304, 303, 305, 305, 306, 306, + 306, 306, 306, 306, 306, 307, 309, 308, 310, 311, + 312, 314, 313, 315, 315, 315, 317, 316, 318, 318, + 319, 319, 321, 320, 323, 322, 325, 324, 327, 326, + 329, 328, 331, 330, 332, 332, 333, 335, 334, 336, + 336, 338, 337, 339, 339, 340, 340, 340, 340, 340, + 341, 343, 342, 345, 344, 346, 346, 348, 347, 349, + 349, 351, 350 + }; + + const unsigned char + Dhcp4Parser::yyr2_[] = + { + 0, 2, 0, 3, 0, 3, 0, 3, 0, 3, + 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, + 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 4, 0, 1, 3, 5, 0, 4, 0, 4, + 0, 1, 1, 3, 2, 0, 4, 1, 3, 1, + 1, 1, 1, 1, 0, 6, 0, 4, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 3, 3, 3, 0, 6, 0, 4, 0, 4, + 0, 6, 0, 6, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 4, 0, 4, 0, + 4, 0, 4, 0, 4, 3, 3, 3, 1, 0, + 6, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 0, 6, 0, 1, 1, 3, 0, 4, 0, 4, + 1, 3, 1, 1, 1, 0, 4, 0, 4, 0, + 6, 1, 3, 3, 0, 6, 0, 1, 1, 3, + 0, 4, 0, 4, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 4, 0, 4, 0, 4, 0, + 4, 0, 4, 0, 4, 0, 4, 3, 3, 0, + 6, 0, 1, 1, 3, 0, 4, 0, 4, 0, + 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 1, 1, 0, 4, 0, 4, 1, + 0, 4, 3, 0, 6, 0, 1, 1, 3, 0, + 4, 0, 4, 0, 1, 1, 3, 1, 1, 1, + 1, 1, 1, 1, 0, 4, 1, 1, 3, 0, + 6, 0, 1, 1, 3, 0, 4, 0, 4, 1, + 3, 1, 1, 1, 0, 4, 0, 6, 0, 1, + 1, 3, 0, 4, 0, 4, 0, 1, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, + 4, 0, 4, 0, 6, 0, 4, 0, 6, 1, + 3, 0, 4, 0, 1, 1, 3, 1, 1, 1, + 1, 1, 0, 4, 0, 6, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 3, 0, 4, 3, 3, + 3, 0, 4, 1, 1, 1, 0, 6, 1, 3, + 1, 1, 0, 4, 0, 4, 0, 6, 0, 4, + 0, 4, 0, 6, 1, 3, 1, 0, 6, 1, + 3, 0, 4, 1, 3, 1, 1, 1, 1, 1, + 3, 0, 4, 0, 6, 1, 3, 0, 4, 1, + 3, 0, 4 + }; + + + + // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + // First, the terminals, then, starting at \a yyntokens_, nonterminals. + const char* + const Dhcp4Parser::yytname_[] = + { + "\"end of file\"", "error", "$undefined", "\",\"", "\":\"", "\"[\"", + "\"]\"", "\"{\"", "\"}\"", "\"null\"", "\"Dhcp4\"", + "\"interfaces-config\"", "\"interfaces\"", "\"lease-database\"", + "\"hosts-database\"", "\"type\"", "\"user\"", "\"password\"", "\"host\"", + "\"persist\"", "\"lfc-interval\"", "\"readonly\"", "\"valid-lifetime\"", + "\"renew-timer\"", "\"rebind-timer\"", "\"decline-probation-period\"", + "\"subnet4\"", "\"4o6-interface\"", "\"4o6-subnet\"", "\"option-def\"", + "\"option-data\"", "\"name\"", "\"data\"", "\"code\"", "\"space\"", + "\"csv-format\"", "\"record-types\"", "\"encapsulate\"", "\"array\"", + "\"pools\"", "\"pool\"", "\"subnet\"", "\"interface\"", + "\"interface-id\"", "\"id\"", "\"rapid-commit\"", "\"reservation-mode\"", + "\"host-reservation-identifiers\"", "\"client-classes\"", "\"test\"", + "\"client-class\"", "\"reservations\"", "\"duid\"", "\"hw-address\"", + "\"circuit-id\"", "\"client-id\"", "\"hostname\"", "\"relay\"", + "\"ip-address\"", "\"hooks-libraries\"", "\"library\"", "\"parameters\"", + "\"expired-leases-processing\"", "\"server-id\"", "\"identifier\"", + "\"htype\"", "\"time\"", "\"enterprise-id\"", "\"dhcp4o6-port\"", + "\"version\"", "\"control-socket\"", "\"socket-type\"", + "\"socket-name\"", "\"dhcp-ddns\"", "\"Logging\"", "\"loggers\"", + "\"output_options\"", "\"output\"", "\"debuglevel\"", "\"severity\"", + "\"Dhcp6\"", "\"DhcpDdns\"", "TOPLEVEL_JSON", "TOPLEVEL_DHCP4", + "SUB_DHCP4", "SUB_INTERFACES4", "SUB_SUBNET4", "SUB_POOL4", + "SUB_RESERVATION", "SUB_OPTION_DEF", "SUB_OPTION_DATA", + "SUB_HOOKS_LIBRARY", "\"constant string\"", "\"integer\"", + "\"floating point\"", "\"boolean\"", "$accept", "start", "$@1", "$@2", + "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", "$@9", "$@10", "value", + "sub_json", "map2", "$@11", "map_content", "not_empty_map", + "list_generic", "$@12", "list2", "$@13", "list_content", + "not_empty_list", "unknown_map_entry", "syntax_map", "$@14", + "global_objects", "global_object", "dhcp4_object", "$@15", "sub_dhcp4", + "$@16", "global_params", "global_param", "valid_lifetime", "renew_timer", + "rebind_timer", "decline_probation_period", "interfaces_config", "$@17", + "sub_interfaces4", "$@18", "interface_config_map", "$@19", + "lease_database", "$@20", "hosts_database", "$@21", + "database_map_params", "database_map_param", "type", "$@22", "user", + "$@23", "password", "$@24", "host", "$@25", "name", "$@26", "persist", + "lfc_interval", "readonly", "duid_id", "host_reservation_identifiers", + "$@27", "host_reservation_identifiers_list", + "host_reservation_identifier", "hw_address_id", "circuit_id", + "client_id", "hooks_libraries", "$@28", "hooks_libraries_list", + "not_empty_hooks_libraries_list", "hooks_library", "$@29", + "sub_hooks_library", "$@30", "hooks_params", "hooks_param", "library", + "$@31", "parameters", "$@32", "expired_leases_processing", "$@33", + "expired_leases_params", "expired_leases_param", "subnet4_list", "$@34", + "subnet4_list_content", "not_empty_subnet4_list", "subnet4", "$@35", + "sub_subnet4", "$@36", "subnet4_params", "subnet4_param", "subnet", + "$@37", "subnet_4o6_interface", "$@38", "subnet_4o6_subnet", "$@39", + "interface", "$@40", "interface_id", "$@41", "client_class", "$@42", + "reservation_mode", "$@43", "id", "rapid_commit", "option_def_list", + "$@44", "option_def_list_content", "not_empty_option_def_list", + "option_def_entry", "$@45", "sub_option_def", "$@46", + "option_def_params", "not_empty_option_def_params", "option_def_param", + "option_def_name", "code", "option_def_code", "option_def_type", + "option_def_record_types", "$@47", "space", "$@48", "option_def_space", + "option_def_encapsulate", "$@49", "option_def_array", "option_data_list", + "$@50", "option_data_list_content", "not_empty_option_data_list", + "option_data_entry", "$@51", "sub_option_data", "$@52", + "option_data_params", "not_empty_option_data_params", + "option_data_param", "option_data_name", "option_data_data", "$@53", + "option_data_code", "option_data_space", "option_data_csv_format", + "pools_list", "$@54", "pools_list_content", "not_empty_pools_list", + "pool_list_entry", "$@55", "sub_pool4", "$@56", "pool_params", + "pool_param", "pool_entry", "$@57", "reservations", "$@58", + "reservations_list", "not_empty_reservations_list", "reservation", + "$@59", "sub_reservation", "$@60", "reservation_params", + "not_empty_reservation_params", "reservation_param", "ip_address", + "$@61", "duid", "$@62", "hw_address", "$@63", "client_id_value", "$@64", + "circuit_id_value", "$@65", "hostname", "$@66", + "reservation_client_classes", "$@67", "relay", "$@68", "relay_map", + "$@69", "client_classes", "$@70", "client_classes_list", "$@71", + "client_class_params", "not_empty_client_class_params", + "client_class_param", "client_class_name", "client_class_test", "$@72", + "server_id", "$@73", "server_id_params", "server_id_param", "htype", + "identifier", "$@74", "time", "enterprise_id", "dhcp4o6_port", "version", + "$@75", "version_value", "control_socket", "$@76", + "control_socket_params", "control_socket_param", "socket_type", "$@77", + "socket_name", "$@78", "dhcp_ddns", "$@79", "dhcp6_json_object", "$@80", + "dhcpddns_json_object", "$@81", "logging_object", "$@82", + "logging_params", "logging_param", "loggers", "$@83", "loggers_entries", + "logger_entry", "$@84", "logger_params", "logger_param", "debuglevel", + "severity", "$@85", "output_options_list", "$@86", + "output_options_list_content", "output_entry", "$@87", "output_params", + "output_param", "$@88", YY_NULLPTR + }; + +#if PARSER4_DEBUG + const unsigned short int + Dhcp4Parser::yyrline_[] = + { + 0, 192, 192, 192, 193, 193, 194, 194, 195, 195, + 196, 196, 197, 197, 198, 198, 199, 199, 200, 200, + 201, 201, 209, 210, 211, 212, 213, 214, 215, 218, + 223, 223, 235, 236, 239, 243, 250, 250, 258, 258, + 265, 266, 269, 273, 284, 294, 294, 306, 307, 311, + 312, 313, 314, 315, 318, 318, 335, 335, 343, 344, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 371, 376, 381, 386, 391, 391, 401, 401, 409, 409, + 419, 419, 429, 429, 439, 440, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 454, 454, 462, 462, 470, + 470, 478, 478, 486, 486, 494, 499, 504, 509, 514, + 514, 524, 525, 528, 529, 530, 531, 534, 539, 544, + 549, 549, 559, 560, 563, 564, 567, 567, 575, 575, + 583, 584, 585, 588, 589, 592, 592, 600, 600, 608, + 608, 618, 619, 625, 633, 633, 646, 647, 650, 651, + 658, 658, 681, 681, 690, 691, 695, 696, 697, 698, + 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, + 709, 710, 711, 714, 714, 722, 722, 730, 730, 738, + 738, 746, 746, 754, 754, 762, 762, 770, 775, 784, + 784, 796, 797, 800, 801, 806, 806, 817, 817, 827, + 828, 831, 832, 835, 836, 837, 838, 839, 840, 841, + 842, 845, 847, 852, 854, 856, 856, 864, 864, 872, + 874, 874, 882, 891, 891, 903, 904, 909, 910, 915, + 915, 926, 926, 937, 938, 943, 944, 949, 950, 951, + 952, 953, 954, 957, 959, 959, 967, 969, 971, 979, + 979, 991, 992, 995, 996, 999, 999, 1007, 1007, 1015, + 1016, 1019, 1020, 1021, 1024, 1024, 1035, 1035, 1045, 1046, + 1049, 1050, 1053, 1053, 1061, 1061, 1069, 1070, 1073, 1074, + 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1089, + 1089, 1095, 1095, 1103, 1103, 1111, 1111, 1119, 1119, 1128, + 1128, 1136, 1136, 1149, 1149, 1159, 1159, 1170, 1170, 1180, + 1181, 1184, 1184, 1192, 1193, 1196, 1197, 1200, 1201, 1202, + 1203, 1206, 1208, 1208, 1219, 1219, 1229, 1230, 1233, 1234, + 1235, 1236, 1237, 1238, 1239, 1242, 1247, 1247, 1255, 1260, + 1267, 1273, 1273, 1281, 1282, 1283, 1288, 1288, 1298, 1299, + 1302, 1303, 1306, 1306, 1314, 1314, 1324, 1324, 1336, 1336, + 1343, 1343, 1355, 1355, 1368, 1369, 1373, 1377, 1377, 1389, + 1390, 1394, 1394, 1402, 1403, 1406, 1407, 1408, 1409, 1410, + 1413, 1417, 1417, 1425, 1425, 1435, 1436, 1439, 1439, 1447, + 1448, 1451, 1451 + }; + + // Print the state stack on the debug stream. + void + Dhcp4Parser::yystack_print_ () + { + *yycdebug_ << "Stack now"; + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << i->state; + *yycdebug_ << std::endl; + } + + // Report on the debug stream that the rule \a yyrule is going to be reduced. + void + Dhcp4Parser::yy_reduce_print_ (int yyrule) + { + unsigned int yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + // Print the symbols being reduced, and their result. + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):" << std::endl; + // The symbols being reduced. + for (int yyi = 0; yyi < yynrhs; yyi++) + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + yystack_[(yynrhs) - (yyi + 1)]); + } +#endif // PARSER4_DEBUG + + +#line 14 "dhcp4_parser.yy" // lalr1.cc:1167 +} } // isc::dhcp +#line 3397 "dhcp4_parser.cc" // lalr1.cc:1167 +#line 1459 "dhcp4_parser.yy" // lalr1.cc:1168 + + +void +isc::dhcp::Dhcp4Parser::error(const location_type& loc, + const std::string& what) +{ + ctx.error(loc, what); +} diff --git a/src/bin/dhcp4/dhcp4_parser.h b/src/bin/dhcp4/dhcp4_parser.h new file mode 100644 index 0000000000..803869603f --- /dev/null +++ b/src/bin/dhcp4/dhcp4_parser.h @@ -0,0 +1,2066 @@ +// A Bison parser, made by GNU Bison 3.0.4. + +// Skeleton interface 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 . + +// 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. + +/** + ** \file dhcp4_parser.h + ** Define the isc::dhcp::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +#ifndef YY_PARSER4_DHCP4_PARSER_H_INCLUDED +# define YY_PARSER4_DHCP4_PARSER_H_INCLUDED +// // "%code requires" blocks. +#line 17 "dhcp4_parser.yy" // lalr1.cc:377 + +#include +#include +#include +#include +#include + +using namespace isc::dhcp; +using namespace isc::data; +using namespace std; + +#line 56 "dhcp4_parser.h" // lalr1.cc:377 + +# include +# include // std::abort +# include +# include +# include +# include +# include "stack.hh" +# include "location.hh" +#include +#ifndef YYASSERT +# include +# define YYASSERT assert +#endif + + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(E) ((void) (E)) +#else +# define YYUSE(E) /* empty */ +#endif + +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +/* Debug traces. */ +#ifndef PARSER4_DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define PARSER4_DEBUG 1 +# else +# define PARSER4_DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define PARSER4_DEBUG 1 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined PARSER4_DEBUG */ + +#line 14 "dhcp4_parser.yy" // lalr1.cc:377 +namespace isc { namespace dhcp { +#line 141 "dhcp4_parser.h" // lalr1.cc:377 + + + + /// A char[S] buffer to store and retrieve objects. + /// + /// Sort of a variant, but does not keep track of the nature + /// of the stored data, since that knowledge is available + /// via the current state. + template + struct variant + { + /// Type of *this. + typedef variant self_type; + + /// Empty construction. + variant () + : yytypeid_ (YY_NULLPTR) + {} + + /// Construct and fill. + template + variant (const T& t) + : yytypeid_ (&typeid (T)) + { + YYASSERT (sizeof (T) <= S); + new (yyas_ ()) T (t); + } + + /// Destruction, allowed only if empty. + ~variant () + { + YYASSERT (!yytypeid_); + } + + /// Instantiate an empty \a T in here. + template + T& + build () + { + YYASSERT (!yytypeid_); + YYASSERT (sizeof (T) <= S); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T; + } + + /// Instantiate a \a T in here from \a t. + template + T& + build (const T& t) + { + YYASSERT (!yytypeid_); + YYASSERT (sizeof (T) <= S); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (t); + } + + /// Accessor to a built \a T. + template + T& + as () + { + YYASSERT (*yytypeid_ == typeid (T)); + YYASSERT (sizeof (T) <= S); + return *yyas_ (); + } + + /// Const accessor to a built \a T (for %printer). + template + const T& + as () const + { + YYASSERT (*yytypeid_ == typeid (T)); + YYASSERT (sizeof (T) <= S); + return *yyas_ (); + } + + /// Swap the content with \a other, of same type. + /// + /// Both variants must be built beforehand, because swapping the actual + /// data requires reading it (with as()), and this is not possible on + /// unconstructed variants: it would require some dynamic testing, which + /// should not be the variant's responsability. + /// Swapping between built and (possibly) non-built is done with + /// variant::move (). + template + void + swap (self_type& other) + { + YYASSERT (yytypeid_); + YYASSERT (*yytypeid_ == *other.yytypeid_); + std::swap (as (), other.as ()); + } + + /// Move the content of \a other to this. + /// + /// Destroys \a other. + template + void + move (self_type& other) + { + build (); + swap (other); + other.destroy (); + } + + /// Copy the content of \a other to this. + template + void + copy (const self_type& other) + { + build (other.as ()); + } + + /// Destroy the stored \a T. + template + void + destroy () + { + as ().~T (); + yytypeid_ = YY_NULLPTR; + } + + private: + /// Prohibit blind copies. + self_type& operator=(const self_type&); + variant (const self_type&); + + /// Accessor to raw memory as \a T. + template + T* + yyas_ () + { + void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// Const accessor to raw memory as \a T. + template + const T* + yyas_ () const + { + const void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + union + { + /// Strongest alignment constraints. + long double yyalign_me; + /// A buffer large enough to store any of the semantic values. + char yyraw[S]; + } yybuffer_; + + /// Whether the content is built: if defined, the name of the stored type. + const std::type_info *yytypeid_; + }; + + + /// A Bison parser. + class Dhcp4Parser + { + public: +#ifndef PARSER4_STYPE + /// An auxiliary type to compute the largest semantic type. + union union_type + { + // value + // version_value + char dummy1[sizeof(ElementPtr)]; + + // "boolean" + char dummy2[sizeof(bool)]; + + // "floating point" + char dummy3[sizeof(double)]; + + // "integer" + char dummy4[sizeof(int64_t)]; + + // "constant string" + char dummy5[sizeof(std::string)]; +}; + + /// Symbol semantic values. + typedef variant semantic_type; +#else + typedef PARSER4_STYPE semantic_type; +#endif + /// Symbol locations. + typedef location location_type; + + /// Syntax errors thrown from user actions. + struct syntax_error : std::runtime_error + { + syntax_error (const location_type& l, const std::string& m); + location_type location; + }; + + /// Tokens. + struct token + { + enum yytokentype + { + TOKEN_END = 0, + TOKEN_COMMA = 258, + TOKEN_COLON = 259, + TOKEN_LSQUARE_BRACKET = 260, + TOKEN_RSQUARE_BRACKET = 261, + TOKEN_LCURLY_BRACKET = 262, + TOKEN_RCURLY_BRACKET = 263, + TOKEN_NULL_TYPE = 264, + TOKEN_DHCP4 = 265, + TOKEN_INTERFACES_CONFIG = 266, + TOKEN_INTERFACES = 267, + TOKEN_LEASE_DATABASE = 268, + TOKEN_HOSTS_DATABASE = 269, + TOKEN_TYPE = 270, + TOKEN_USER = 271, + TOKEN_PASSWORD = 272, + TOKEN_HOST = 273, + TOKEN_PERSIST = 274, + TOKEN_LFC_INTERVAL = 275, + TOKEN_READONLY = 276, + TOKEN_VALID_LIFETIME = 277, + TOKEN_RENEW_TIMER = 278, + TOKEN_REBIND_TIMER = 279, + TOKEN_DECLINE_PROBATION_PERIOD = 280, + TOKEN_SUBNET4 = 281, + TOKEN_SUBNET_4O6_INTERFACE = 282, + TOKEN_SUBNET_4O6_SUBNET = 283, + TOKEN_OPTION_DEF = 284, + TOKEN_OPTION_DATA = 285, + TOKEN_NAME = 286, + TOKEN_DATA = 287, + TOKEN_CODE = 288, + TOKEN_SPACE = 289, + TOKEN_CSV_FORMAT = 290, + TOKEN_RECORD_TYPES = 291, + TOKEN_ENCAPSULATE = 292, + TOKEN_ARRAY = 293, + TOKEN_POOLS = 294, + TOKEN_POOL = 295, + TOKEN_SUBNET = 296, + TOKEN_INTERFACE = 297, + TOKEN_INTERFACE_ID = 298, + TOKEN_ID = 299, + TOKEN_RAPID_COMMIT = 300, + TOKEN_RESERVATION_MODE = 301, + TOKEN_HOST_RESERVATION_IDENTIFIERS = 302, + TOKEN_CLIENT_CLASSES = 303, + TOKEN_TEST = 304, + TOKEN_CLIENT_CLASS = 305, + TOKEN_RESERVATIONS = 306, + TOKEN_DUID = 307, + TOKEN_HW_ADDRESS = 308, + TOKEN_CIRCUIT_ID = 309, + TOKEN_CLIENT_ID = 310, + TOKEN_HOSTNAME = 311, + TOKEN_RELAY = 312, + TOKEN_IP_ADDRESS = 313, + TOKEN_HOOKS_LIBRARIES = 314, + TOKEN_LIBRARY = 315, + TOKEN_PARAMETERS = 316, + TOKEN_EXPIRED_LEASES_PROCESSING = 317, + TOKEN_SERVER_ID = 318, + TOKEN_IDENTIFIER = 319, + TOKEN_HTYPE = 320, + TOKEN_TIME = 321, + TOKEN_ENTERPRISE_ID = 322, + TOKEN_DHCP4O6_PORT = 323, + TOKEN_VERSION = 324, + TOKEN_CONTROL_SOCKET = 325, + TOKEN_SOCKET_TYPE = 326, + TOKEN_SOCKET_NAME = 327, + TOKEN_DHCP_DDNS = 328, + TOKEN_LOGGING = 329, + TOKEN_LOGGERS = 330, + TOKEN_OUTPUT_OPTIONS = 331, + TOKEN_OUTPUT = 332, + TOKEN_DEBUGLEVEL = 333, + TOKEN_SEVERITY = 334, + TOKEN_DHCP6 = 335, + TOKEN_DHCPDDNS = 336, + TOKEN_TOPLEVEL_JSON = 337, + TOKEN_TOPLEVEL_DHCP4 = 338, + TOKEN_SUB_DHCP4 = 339, + TOKEN_SUB_INTERFACES4 = 340, + TOKEN_SUB_SUBNET4 = 341, + TOKEN_SUB_POOL4 = 342, + TOKEN_SUB_RESERVATION = 343, + TOKEN_SUB_OPTION_DEF = 344, + TOKEN_SUB_OPTION_DATA = 345, + TOKEN_SUB_HOOKS_LIBRARY = 346, + TOKEN_STRING = 347, + TOKEN_INTEGER = 348, + TOKEN_FLOAT = 349, + TOKEN_BOOLEAN = 350 + }; + }; + + /// (External) token type, as returned by yylex. + typedef token::yytokentype token_type; + + /// Symbol type: an internal symbol number. + typedef int symbol_number_type; + + /// The symbol type number to denote an empty symbol. + enum { empty_symbol = -2 }; + + /// Internal symbol number for tokens (subsumed by symbol_number_type). + typedef unsigned char token_number_type; + + /// A complete symbol. + /// + /// Expects its Base type to provide access to the symbol type + /// via type_get(). + /// + /// Provide access to semantic value and location. + template + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; + + /// Default constructor. + basic_symbol (); + + /// Copy constructor. + basic_symbol (const basic_symbol& other); + + /// Constructor for valueless symbols, and symbols from each type. + + basic_symbol (typename Base::kind_type t, const location_type& l); + + basic_symbol (typename Base::kind_type t, const ElementPtr v, const location_type& l); + + basic_symbol (typename Base::kind_type t, const bool v, const location_type& l); + + basic_symbol (typename Base::kind_type t, const double v, const location_type& l); + + basic_symbol (typename Base::kind_type t, const int64_t v, const location_type& l); + + basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l); + + + /// Constructor for symbols with semantic value. + basic_symbol (typename Base::kind_type t, + const semantic_type& v, + const location_type& l); + + /// Destroy the symbol. + ~basic_symbol (); + + /// Destroy contents, and record that is empty. + void clear (); + + /// Whether empty. + bool empty () const; + + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); + + /// The semantic value. + semantic_type value; + + /// The location. + location_type location; + + private: + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& other); + }; + + /// Type access provider for token (enum) based symbols. + struct by_type + { + /// Default constructor. + by_type (); + + /// Copy constructor. + by_type (const by_type& other); + + /// The symbol type as needed by the constructor. + typedef token_type kind_type; + + /// Constructor from (external) token numbers. + by_type (kind_type t); + + /// Record that this symbol is empty. + void clear (); + + /// Steal the symbol type from \a that. + void move (by_type& that); + + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_number_type type_get () const; + + /// The token. + token_type token () const; + + /// The symbol type. + /// \a empty_symbol when empty. + /// An int, not token_number_type, to be able to store empty_symbol. + int type; + }; + + /// "External" symbols: returned by the scanner. + typedef basic_symbol symbol_type; + + // Symbol constructors declarations. + static inline + symbol_type + make_END (const location_type& l); + + static inline + symbol_type + make_COMMA (const location_type& l); + + static inline + symbol_type + make_COLON (const location_type& l); + + static inline + symbol_type + make_LSQUARE_BRACKET (const location_type& l); + + static inline + symbol_type + make_RSQUARE_BRACKET (const location_type& l); + + static inline + symbol_type + make_LCURLY_BRACKET (const location_type& l); + + static inline + symbol_type + make_RCURLY_BRACKET (const location_type& l); + + static inline + symbol_type + make_NULL_TYPE (const location_type& l); + + static inline + symbol_type + make_DHCP4 (const location_type& l); + + static inline + symbol_type + make_INTERFACES_CONFIG (const location_type& l); + + static inline + symbol_type + make_INTERFACES (const location_type& l); + + static inline + symbol_type + make_LEASE_DATABASE (const location_type& l); + + static inline + symbol_type + make_HOSTS_DATABASE (const location_type& l); + + static inline + symbol_type + make_TYPE (const location_type& l); + + static inline + symbol_type + make_USER (const location_type& l); + + static inline + symbol_type + make_PASSWORD (const location_type& l); + + static inline + symbol_type + make_HOST (const location_type& l); + + static inline + symbol_type + make_PERSIST (const location_type& l); + + static inline + symbol_type + make_LFC_INTERVAL (const location_type& l); + + static inline + symbol_type + make_READONLY (const location_type& l); + + static inline + symbol_type + make_VALID_LIFETIME (const location_type& l); + + static inline + symbol_type + make_RENEW_TIMER (const location_type& l); + + static inline + symbol_type + make_REBIND_TIMER (const location_type& l); + + static inline + symbol_type + make_DECLINE_PROBATION_PERIOD (const location_type& l); + + static inline + symbol_type + make_SUBNET4 (const location_type& l); + + static inline + symbol_type + make_SUBNET_4O6_INTERFACE (const location_type& l); + + static inline + symbol_type + make_SUBNET_4O6_SUBNET (const location_type& l); + + static inline + symbol_type + make_OPTION_DEF (const location_type& l); + + static inline + symbol_type + make_OPTION_DATA (const location_type& l); + + static inline + symbol_type + make_NAME (const location_type& l); + + static inline + symbol_type + make_DATA (const location_type& l); + + static inline + symbol_type + make_CODE (const location_type& l); + + static inline + symbol_type + make_SPACE (const location_type& l); + + static inline + symbol_type + make_CSV_FORMAT (const location_type& l); + + static inline + symbol_type + make_RECORD_TYPES (const location_type& l); + + static inline + symbol_type + make_ENCAPSULATE (const location_type& l); + + static inline + symbol_type + make_ARRAY (const location_type& l); + + static inline + symbol_type + make_POOLS (const location_type& l); + + static inline + symbol_type + make_POOL (const location_type& l); + + static inline + symbol_type + make_SUBNET (const location_type& l); + + static inline + symbol_type + make_INTERFACE (const location_type& l); + + static inline + symbol_type + make_INTERFACE_ID (const location_type& l); + + static inline + symbol_type + make_ID (const location_type& l); + + static inline + symbol_type + make_RAPID_COMMIT (const location_type& l); + + static inline + symbol_type + make_RESERVATION_MODE (const location_type& l); + + static inline + symbol_type + make_HOST_RESERVATION_IDENTIFIERS (const location_type& l); + + static inline + symbol_type + make_CLIENT_CLASSES (const location_type& l); + + static inline + symbol_type + make_TEST (const location_type& l); + + static inline + symbol_type + make_CLIENT_CLASS (const location_type& l); + + static inline + symbol_type + make_RESERVATIONS (const location_type& l); + + static inline + symbol_type + make_DUID (const location_type& l); + + static inline + symbol_type + make_HW_ADDRESS (const location_type& l); + + static inline + symbol_type + make_CIRCUIT_ID (const location_type& l); + + static inline + symbol_type + make_CLIENT_ID (const location_type& l); + + static inline + symbol_type + make_HOSTNAME (const location_type& l); + + static inline + symbol_type + make_RELAY (const location_type& l); + + static inline + symbol_type + make_IP_ADDRESS (const location_type& l); + + static inline + symbol_type + make_HOOKS_LIBRARIES (const location_type& l); + + static inline + symbol_type + make_LIBRARY (const location_type& l); + + static inline + symbol_type + make_PARAMETERS (const location_type& l); + + static inline + symbol_type + make_EXPIRED_LEASES_PROCESSING (const location_type& l); + + static inline + symbol_type + make_SERVER_ID (const location_type& l); + + static inline + symbol_type + make_IDENTIFIER (const location_type& l); + + static inline + symbol_type + make_HTYPE (const location_type& l); + + static inline + symbol_type + make_TIME (const location_type& l); + + static inline + symbol_type + make_ENTERPRISE_ID (const location_type& l); + + static inline + symbol_type + make_DHCP4O6_PORT (const location_type& l); + + static inline + symbol_type + make_VERSION (const location_type& l); + + static inline + symbol_type + make_CONTROL_SOCKET (const location_type& l); + + static inline + symbol_type + make_SOCKET_TYPE (const location_type& l); + + static inline + symbol_type + make_SOCKET_NAME (const location_type& l); + + static inline + symbol_type + make_DHCP_DDNS (const location_type& l); + + static inline + symbol_type + make_LOGGING (const location_type& l); + + static inline + symbol_type + make_LOGGERS (const location_type& l); + + static inline + symbol_type + make_OUTPUT_OPTIONS (const location_type& l); + + static inline + symbol_type + make_OUTPUT (const location_type& l); + + static inline + symbol_type + make_DEBUGLEVEL (const location_type& l); + + static inline + symbol_type + make_SEVERITY (const location_type& l); + + static inline + symbol_type + make_DHCP6 (const location_type& l); + + static inline + symbol_type + make_DHCPDDNS (const location_type& l); + + static inline + symbol_type + make_TOPLEVEL_JSON (const location_type& l); + + static inline + symbol_type + make_TOPLEVEL_DHCP4 (const location_type& l); + + static inline + symbol_type + make_SUB_DHCP4 (const location_type& l); + + static inline + symbol_type + make_SUB_INTERFACES4 (const location_type& l); + + static inline + symbol_type + make_SUB_SUBNET4 (const location_type& l); + + static inline + symbol_type + make_SUB_POOL4 (const location_type& l); + + static inline + symbol_type + make_SUB_RESERVATION (const location_type& l); + + static inline + symbol_type + make_SUB_OPTION_DEF (const location_type& l); + + static inline + symbol_type + make_SUB_OPTION_DATA (const location_type& l); + + static inline + symbol_type + make_SUB_HOOKS_LIBRARY (const location_type& l); + + static inline + symbol_type + make_STRING (const std::string& v, const location_type& l); + + static inline + symbol_type + make_INTEGER (const int64_t& v, const location_type& l); + + static inline + symbol_type + make_FLOAT (const double& v, const location_type& l); + + static inline + symbol_type + make_BOOLEAN (const bool& v, const location_type& l); + + + /// Build a parser object. + Dhcp4Parser (isc::dhcp::Parser4Context& ctx_yyarg); + virtual ~Dhcp4Parser (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + +#if PARSER4_DEBUG + /// The current debugging stream. + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; + /// Set the current debugging stream. + void set_debug_stream (std::ostream &); + + /// Type for debugging levels. + typedef int debug_level_type; + /// The current debugging level. + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; + /// Set the current debugging level. + void set_debug_level (debug_level_type l); +#endif + + /// Report a syntax error. + /// \param loc where the syntax error is found. + /// \param msg a description of the syntax error. + virtual void error (const location_type& loc, const std::string& msg); + + /// Report a syntax error. + void error (const syntax_error& err); + + private: + /// This class is not copyable. + Dhcp4Parser (const Dhcp4Parser&); + Dhcp4Parser& operator= (const Dhcp4Parser&); + + /// State numbers. + typedef int state_type; + + /// Generate an error message. + /// \param yystate the state where the error occurred. + /// \param yyla the lookahead token. + virtual std::string yysyntax_error_ (state_type yystate, + const symbol_type& yyla) const; + + /// Compute post-reduction state. + /// \param yystate the current state + /// \param yysym the nonterminal to push on the stack + state_type yy_lr_goto_state_ (state_type yystate, int yysym); + + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + + static const short int yypact_ninf_; + static const signed char yytable_ninf_; + + /// Convert a scanner token number \a t to a symbol number. + static token_number_type yytranslate_ (token_type t); + + // Tables. + // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + // STATE-NUM. + static const short int yypact_[]; + + // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + // Performed when YYTABLE does not specify something else to do. Zero + // means the default is an error. + static const unsigned short int yydefact_[]; + + // YYPGOTO[NTERM-NUM]. + static const short int yypgoto_[]; + + // YYDEFGOTO[NTERM-NUM]. + static const short int yydefgoto_[]; + + // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + // positive, shift that token. If negative, reduce the rule whose + // number is the opposite. If YYTABLE_NINF, syntax error. + static const unsigned short int yytable_[]; + + static const short int yycheck_[]; + + // YYSTOS[STATE-NUM] -- The (internal number of the) accessing + // symbol of state STATE-NUM. + static const unsigned short int yystos_[]; + + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + static const unsigned short int yyr1_[]; + + // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + static const unsigned char yyr2_[]; + + + /// Convert the symbol name \a n to a form suitable for a diagnostic. + static std::string yytnamerr_ (const char *n); + + + /// For a symbol, its name in clear. + static const char* const yytname_[]; +#if PARSER4_DEBUG + // YYRLINE[YYN] -- Source line where rule number YYN was defined. + static const unsigned short int yyrline_[]; + /// Report on the debug stream that the rule \a r is going to be reduced. + virtual void yy_reduce_print_ (int r); + /// Print the state stack on the debug stream. + virtual void yystack_print_ (); + + // Debugging. + int yydebug_; + std::ostream* yycdebug_; + + /// \brief Display a symbol type, value and location. + /// \param yyo The output stream. + /// \param yysym The symbol. + template + void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; +#endif + + /// \brief Reclaim the memory associated to a symbol. + /// \param yymsg Why this token is reclaimed. + /// If null, print nothing. + /// \param yysym The symbol. + template + void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; + + private: + /// Type access provider for state based symbols. + struct by_state + { + /// Default constructor. + by_state (); + + /// The symbol type as needed by the constructor. + typedef state_type kind_type; + + /// Constructor. + by_state (kind_type s); + + /// Copy constructor. + by_state (const by_state& other); + + /// Record that this symbol is empty. + void clear (); + + /// Steal the symbol type from \a that. + void move (by_state& that); + + /// The (internal) type number (corresponding to \a state). + /// \a empty_symbol when empty. + symbol_number_type type_get () const; + + /// The state number used to denote an empty symbol. + enum { empty_state = -1 }; + + /// The state. + /// \a empty when empty. + state_type state; + }; + + /// "Internal" symbol: element of the stack. + struct stack_symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, symbol_type& sym); + /// Assignment, needed by push_back. + stack_symbol_type& operator= (const stack_symbol_type& that); + }; + + /// Stack type. + typedef stack stack_type; + + /// The stack. + stack_type yystack_; + + /// Push a new state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the symbol + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, stack_symbol_type& s); + + /// Push a new look ahead token on the state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the state + /// \param sym the symbol (for its value and location). + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, state_type s, symbol_type& sym); + + /// Pop \a n symbols the three stacks. + void yypop_ (unsigned int n = 1); + + /// Constants. + enum + { + yyeof_ = 0, + yylast_ = 589, ///< Last index in yytable_. + yynnts_ = 256, ///< Number of nonterminal symbols. + yyfinal_ = 22, ///< Termination state number. + yyterror_ = 1, + yyerrcode_ = 256, + yyntokens_ = 96 ///< Number of tokens. + }; + + + // User arguments. + isc::dhcp::Parser4Context& ctx; + }; + + // Symbol number corresponding to token number t. + inline + Dhcp4Parser::token_number_type + Dhcp4Parser::yytranslate_ (token_type t) + { + static + const token_number_type + translate_table[] = + { + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 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 + }; + const unsigned int user_token_number_max_ = 350; + const token_number_type undef_token_ = 2; + + if (static_cast(t) <= yyeof_) + return yyeof_; + else if (static_cast (t) <= user_token_number_max_) + return translate_table[t]; + else + return undef_token_; + } + + inline + Dhcp4Parser::syntax_error::syntax_error (const location_type& l, const std::string& m) + : std::runtime_error (m) + , location (l) + {} + + // basic_symbol. + template + inline + Dhcp4Parser::basic_symbol::basic_symbol () + : value () + {} + + template + inline + Dhcp4Parser::basic_symbol::basic_symbol (const basic_symbol& other) + : Base (other) + , value () + , location (other.location) + { + switch (other.type_get ()) + { + case 108: // value + case 315: // version_value + value.copy< ElementPtr > (other.value); + break; + + case 95: // "boolean" + value.copy< bool > (other.value); + break; + + case 94: // "floating point" + value.copy< double > (other.value); + break; + + case 93: // "integer" + value.copy< int64_t > (other.value); + break; + + case 92: // "constant string" + value.copy< std::string > (other.value); + break; + + default: + break; + } + + } + + + template + inline + Dhcp4Parser::basic_symbol::basic_symbol (typename Base::kind_type t, const semantic_type& v, const location_type& l) + : Base (t) + , value () + , location (l) + { + (void) v; + switch (this->type_get ()) + { + case 108: // value + case 315: // version_value + value.copy< ElementPtr > (v); + break; + + case 95: // "boolean" + value.copy< bool > (v); + break; + + case 94: // "floating point" + value.copy< double > (v); + break; + + case 93: // "integer" + value.copy< int64_t > (v); + break; + + case 92: // "constant string" + value.copy< std::string > (v); + break; + + default: + break; + } +} + + + // Implementation of basic_symbol constructor for each type. + + template + Dhcp4Parser::basic_symbol::basic_symbol (typename Base::kind_type t, const location_type& l) + : Base (t) + , value () + , location (l) + {} + + template + Dhcp4Parser::basic_symbol::basic_symbol (typename Base::kind_type t, const ElementPtr v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} + + template + Dhcp4Parser::basic_symbol::basic_symbol (typename Base::kind_type t, const bool v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} + + template + Dhcp4Parser::basic_symbol::basic_symbol (typename Base::kind_type t, const double v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} + + template + Dhcp4Parser::basic_symbol::basic_symbol (typename Base::kind_type t, const int64_t v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} + + template + Dhcp4Parser::basic_symbol::basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} + + + template + inline + Dhcp4Parser::basic_symbol::~basic_symbol () + { + clear (); + } + + template + inline + void + Dhcp4Parser::basic_symbol::clear () + { + // User destructor. + symbol_number_type yytype = this->type_get (); + basic_symbol& yysym = *this; + (void) yysym; + switch (yytype) + { + default: + break; + } + + // Type destructor. + switch (yytype) + { + case 108: // value + case 315: // version_value + value.template destroy< ElementPtr > (); + break; + + case 95: // "boolean" + value.template destroy< bool > (); + break; + + case 94: // "floating point" + value.template destroy< double > (); + break; + + case 93: // "integer" + value.template destroy< int64_t > (); + break; + + case 92: // "constant string" + value.template destroy< std::string > (); + break; + + default: + break; + } + + Base::clear (); + } + + template + inline + bool + Dhcp4Parser::basic_symbol::empty () const + { + return Base::type_get () == empty_symbol; + } + + template + inline + void + Dhcp4Parser::basic_symbol::move (basic_symbol& s) + { + super_type::move(s); + switch (this->type_get ()) + { + case 108: // value + case 315: // version_value + value.move< ElementPtr > (s.value); + break; + + case 95: // "boolean" + value.move< bool > (s.value); + break; + + case 94: // "floating point" + value.move< double > (s.value); + break; + + case 93: // "integer" + value.move< int64_t > (s.value); + break; + + case 92: // "constant string" + value.move< std::string > (s.value); + break; + + default: + break; + } + + location = s.location; + } + + // by_type. + inline + Dhcp4Parser::by_type::by_type () + : type (empty_symbol) + {} + + inline + Dhcp4Parser::by_type::by_type (const by_type& other) + : type (other.type) + {} + + inline + Dhcp4Parser::by_type::by_type (token_type t) + : type (yytranslate_ (t)) + {} + + inline + void + Dhcp4Parser::by_type::clear () + { + type = empty_symbol; + } + + inline + void + Dhcp4Parser::by_type::move (by_type& that) + { + type = that.type; + that.clear (); + } + + inline + int + Dhcp4Parser::by_type::type_get () const + { + return type; + } + + inline + Dhcp4Parser::token_type + Dhcp4Parser::by_type::token () const + { + // YYTOKNUM[NUM] -- (External) token number corresponding to the + // (internal) symbol number NUM (which must be that of a token). */ + static + const unsigned short int + yytoken_number_[] = + { + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 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 + }; + return static_cast (yytoken_number_[type]); + } + // Implementation of make_symbol for each symbol type. + Dhcp4Parser::symbol_type + Dhcp4Parser::make_END (const location_type& l) + { + return symbol_type (token::TOKEN_END, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_COMMA (const location_type& l) + { + return symbol_type (token::TOKEN_COMMA, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_COLON (const location_type& l) + { + return symbol_type (token::TOKEN_COLON, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_LSQUARE_BRACKET (const location_type& l) + { + return symbol_type (token::TOKEN_LSQUARE_BRACKET, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_RSQUARE_BRACKET (const location_type& l) + { + return symbol_type (token::TOKEN_RSQUARE_BRACKET, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_LCURLY_BRACKET (const location_type& l) + { + return symbol_type (token::TOKEN_LCURLY_BRACKET, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_RCURLY_BRACKET (const location_type& l) + { + return symbol_type (token::TOKEN_RCURLY_BRACKET, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_NULL_TYPE (const location_type& l) + { + return symbol_type (token::TOKEN_NULL_TYPE, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_DHCP4 (const location_type& l) + { + return symbol_type (token::TOKEN_DHCP4, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_INTERFACES_CONFIG (const location_type& l) + { + return symbol_type (token::TOKEN_INTERFACES_CONFIG, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_INTERFACES (const location_type& l) + { + return symbol_type (token::TOKEN_INTERFACES, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_LEASE_DATABASE (const location_type& l) + { + return symbol_type (token::TOKEN_LEASE_DATABASE, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_HOSTS_DATABASE (const location_type& l) + { + return symbol_type (token::TOKEN_HOSTS_DATABASE, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_TYPE (const location_type& l) + { + return symbol_type (token::TOKEN_TYPE, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_USER (const location_type& l) + { + return symbol_type (token::TOKEN_USER, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_PASSWORD (const location_type& l) + { + return symbol_type (token::TOKEN_PASSWORD, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_HOST (const location_type& l) + { + return symbol_type (token::TOKEN_HOST, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_PERSIST (const location_type& l) + { + return symbol_type (token::TOKEN_PERSIST, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_LFC_INTERVAL (const location_type& l) + { + return symbol_type (token::TOKEN_LFC_INTERVAL, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_READONLY (const location_type& l) + { + return symbol_type (token::TOKEN_READONLY, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_VALID_LIFETIME (const location_type& l) + { + return symbol_type (token::TOKEN_VALID_LIFETIME, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_RENEW_TIMER (const location_type& l) + { + return symbol_type (token::TOKEN_RENEW_TIMER, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_REBIND_TIMER (const location_type& l) + { + return symbol_type (token::TOKEN_REBIND_TIMER, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_DECLINE_PROBATION_PERIOD (const location_type& l) + { + return symbol_type (token::TOKEN_DECLINE_PROBATION_PERIOD, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SUBNET4 (const location_type& l) + { + return symbol_type (token::TOKEN_SUBNET4, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SUBNET_4O6_INTERFACE (const location_type& l) + { + return symbol_type (token::TOKEN_SUBNET_4O6_INTERFACE, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SUBNET_4O6_SUBNET (const location_type& l) + { + return symbol_type (token::TOKEN_SUBNET_4O6_SUBNET, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_OPTION_DEF (const location_type& l) + { + return symbol_type (token::TOKEN_OPTION_DEF, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_OPTION_DATA (const location_type& l) + { + return symbol_type (token::TOKEN_OPTION_DATA, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_NAME (const location_type& l) + { + return symbol_type (token::TOKEN_NAME, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_DATA (const location_type& l) + { + return symbol_type (token::TOKEN_DATA, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_CODE (const location_type& l) + { + return symbol_type (token::TOKEN_CODE, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SPACE (const location_type& l) + { + return symbol_type (token::TOKEN_SPACE, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_CSV_FORMAT (const location_type& l) + { + return symbol_type (token::TOKEN_CSV_FORMAT, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_RECORD_TYPES (const location_type& l) + { + return symbol_type (token::TOKEN_RECORD_TYPES, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_ENCAPSULATE (const location_type& l) + { + return symbol_type (token::TOKEN_ENCAPSULATE, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_ARRAY (const location_type& l) + { + return symbol_type (token::TOKEN_ARRAY, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_POOLS (const location_type& l) + { + return symbol_type (token::TOKEN_POOLS, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_POOL (const location_type& l) + { + return symbol_type (token::TOKEN_POOL, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SUBNET (const location_type& l) + { + return symbol_type (token::TOKEN_SUBNET, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_INTERFACE (const location_type& l) + { + return symbol_type (token::TOKEN_INTERFACE, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_INTERFACE_ID (const location_type& l) + { + return symbol_type (token::TOKEN_INTERFACE_ID, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_ID (const location_type& l) + { + return symbol_type (token::TOKEN_ID, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_RAPID_COMMIT (const location_type& l) + { + return symbol_type (token::TOKEN_RAPID_COMMIT, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_RESERVATION_MODE (const location_type& l) + { + return symbol_type (token::TOKEN_RESERVATION_MODE, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_HOST_RESERVATION_IDENTIFIERS (const location_type& l) + { + return symbol_type (token::TOKEN_HOST_RESERVATION_IDENTIFIERS, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_CLIENT_CLASSES (const location_type& l) + { + return symbol_type (token::TOKEN_CLIENT_CLASSES, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_TEST (const location_type& l) + { + return symbol_type (token::TOKEN_TEST, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_CLIENT_CLASS (const location_type& l) + { + return symbol_type (token::TOKEN_CLIENT_CLASS, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_RESERVATIONS (const location_type& l) + { + return symbol_type (token::TOKEN_RESERVATIONS, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_DUID (const location_type& l) + { + return symbol_type (token::TOKEN_DUID, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_HW_ADDRESS (const location_type& l) + { + return symbol_type (token::TOKEN_HW_ADDRESS, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_CIRCUIT_ID (const location_type& l) + { + return symbol_type (token::TOKEN_CIRCUIT_ID, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_CLIENT_ID (const location_type& l) + { + return symbol_type (token::TOKEN_CLIENT_ID, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_HOSTNAME (const location_type& l) + { + return symbol_type (token::TOKEN_HOSTNAME, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_RELAY (const location_type& l) + { + return symbol_type (token::TOKEN_RELAY, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_IP_ADDRESS (const location_type& l) + { + return symbol_type (token::TOKEN_IP_ADDRESS, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_HOOKS_LIBRARIES (const location_type& l) + { + return symbol_type (token::TOKEN_HOOKS_LIBRARIES, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_LIBRARY (const location_type& l) + { + return symbol_type (token::TOKEN_LIBRARY, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_PARAMETERS (const location_type& l) + { + return symbol_type (token::TOKEN_PARAMETERS, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_EXPIRED_LEASES_PROCESSING (const location_type& l) + { + return symbol_type (token::TOKEN_EXPIRED_LEASES_PROCESSING, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SERVER_ID (const location_type& l) + { + return symbol_type (token::TOKEN_SERVER_ID, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_IDENTIFIER (const location_type& l) + { + return symbol_type (token::TOKEN_IDENTIFIER, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_HTYPE (const location_type& l) + { + return symbol_type (token::TOKEN_HTYPE, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_TIME (const location_type& l) + { + return symbol_type (token::TOKEN_TIME, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_ENTERPRISE_ID (const location_type& l) + { + return symbol_type (token::TOKEN_ENTERPRISE_ID, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_DHCP4O6_PORT (const location_type& l) + { + return symbol_type (token::TOKEN_DHCP4O6_PORT, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_VERSION (const location_type& l) + { + return symbol_type (token::TOKEN_VERSION, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_CONTROL_SOCKET (const location_type& l) + { + return symbol_type (token::TOKEN_CONTROL_SOCKET, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SOCKET_TYPE (const location_type& l) + { + return symbol_type (token::TOKEN_SOCKET_TYPE, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SOCKET_NAME (const location_type& l) + { + return symbol_type (token::TOKEN_SOCKET_NAME, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_DHCP_DDNS (const location_type& l) + { + return symbol_type (token::TOKEN_DHCP_DDNS, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_LOGGING (const location_type& l) + { + return symbol_type (token::TOKEN_LOGGING, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_LOGGERS (const location_type& l) + { + return symbol_type (token::TOKEN_LOGGERS, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_OUTPUT_OPTIONS (const location_type& l) + { + return symbol_type (token::TOKEN_OUTPUT_OPTIONS, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_OUTPUT (const location_type& l) + { + return symbol_type (token::TOKEN_OUTPUT, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_DEBUGLEVEL (const location_type& l) + { + return symbol_type (token::TOKEN_DEBUGLEVEL, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SEVERITY (const location_type& l) + { + return symbol_type (token::TOKEN_SEVERITY, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_DHCP6 (const location_type& l) + { + return symbol_type (token::TOKEN_DHCP6, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_DHCPDDNS (const location_type& l) + { + return symbol_type (token::TOKEN_DHCPDDNS, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_TOPLEVEL_JSON (const location_type& l) + { + return symbol_type (token::TOKEN_TOPLEVEL_JSON, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_TOPLEVEL_DHCP4 (const location_type& l) + { + return symbol_type (token::TOKEN_TOPLEVEL_DHCP4, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SUB_DHCP4 (const location_type& l) + { + return symbol_type (token::TOKEN_SUB_DHCP4, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SUB_INTERFACES4 (const location_type& l) + { + return symbol_type (token::TOKEN_SUB_INTERFACES4, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SUB_SUBNET4 (const location_type& l) + { + return symbol_type (token::TOKEN_SUB_SUBNET4, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SUB_POOL4 (const location_type& l) + { + return symbol_type (token::TOKEN_SUB_POOL4, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SUB_RESERVATION (const location_type& l) + { + return symbol_type (token::TOKEN_SUB_RESERVATION, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SUB_OPTION_DEF (const location_type& l) + { + return symbol_type (token::TOKEN_SUB_OPTION_DEF, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SUB_OPTION_DATA (const location_type& l) + { + return symbol_type (token::TOKEN_SUB_OPTION_DATA, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_SUB_HOOKS_LIBRARY (const location_type& l) + { + return symbol_type (token::TOKEN_SUB_HOOKS_LIBRARY, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_STRING (const std::string& v, const location_type& l) + { + return symbol_type (token::TOKEN_STRING, v, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_INTEGER (const int64_t& v, const location_type& l) + { + return symbol_type (token::TOKEN_INTEGER, v, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_FLOAT (const double& v, const location_type& l) + { + return symbol_type (token::TOKEN_FLOAT, v, l); + } + + Dhcp4Parser::symbol_type + Dhcp4Parser::make_BOOLEAN (const bool& v, const location_type& l) + { + return symbol_type (token::TOKEN_BOOLEAN, v, l); + } + + +#line 14 "dhcp4_parser.yy" // lalr1.cc:377 +} } // isc::dhcp +#line 2062 "dhcp4_parser.h" // lalr1.cc:377 + + + + +#endif // !YY_PARSER4_DHCP4_PARSER_H_INCLUDED diff --git a/src/bin/dhcp4/location.hh b/src/bin/dhcp4/location.hh new file mode 100644 index 0000000000..7e23a2ccac --- /dev/null +++ b/src/bin/dhcp4/location.hh @@ -0,0 +1,192 @@ +// A Bison parser, made by GNU Bison 3.0.4. + +// Locations for Bison 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 . + +// 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. + +/** + ** \file location.hh + ** Define the isc::dhcp::location class. + */ + +#ifndef YY_PARSER4_LOCATION_HH_INCLUDED +# define YY_PARSER4_LOCATION_HH_INCLUDED + +# include "position.hh" + +#line 14 "dhcp4_parser.yy" // location.cc:296 +namespace isc { namespace dhcp { +#line 46 "location.hh" // location.cc:296 + /// Abstract a location. + class location + { + public: + + /// Construct a location from \a b to \a e. + location (const position& b, const position& e) + : begin (b) + , end (e) + { + } + + /// Construct a 0-width location in \a p. + explicit location (const position& p = position ()) + : begin (p) + , end (p) + { + } + + /// Construct a 0-width location in \a f, \a l, \a c. + explicit location (std::string* f, + unsigned int l = 1u, + unsigned int c = 1u) + : begin (f, l, c) + , end (f, l, c) + { + } + + + /// Initialization. + void initialize (std::string* f = YY_NULLPTR, + unsigned int l = 1u, + unsigned int c = 1u) + { + begin.initialize (f, l, c); + end = begin; + } + + /** \name Line and Column related manipulators + ** \{ */ + public: + /// Reset initial location to final location. + void step () + { + begin = end; + } + + /// Extend the current location to the COUNT next columns. + void columns (int count = 1) + { + end += count; + } + + /// Extend the current location to the COUNT next lines. + void lines (int count = 1) + { + end.lines (count); + } + /** \} */ + + + public: + /// Beginning of the located region. + position begin; + /// End of the located region. + position end; + }; + + /// Join two locations, in place. + inline location& operator+= (location& res, const location& end) + { + res.end = end.end; + return res; + } + + /// Join two locations. + inline location operator+ (location res, const location& end) + { + return res += end; + } + + /// Add \a width columns to the end position, in place. + inline location& operator+= (location& res, int width) + { + res.columns (width); + return res; + } + + /// Add \a width columns to the end position. + inline location operator+ (location res, int width) + { + return res += width; + } + + /// Subtract \a width columns to the end position, in place. + inline location& operator-= (location& res, int width) + { + return res += -width; + } + + /// Subtract \a width columns to the end position. + inline location operator- (location res, int width) + { + return res -= width; + } + + /// Compare two location objects. + inline bool + operator== (const location& loc1, const location& loc2) + { + return loc1.begin == loc2.begin && loc1.end == loc2.end; + } + + /// Compare two location objects. + inline bool + operator!= (const location& loc1, const location& loc2) + { + return !(loc1 == loc2); + } + + /** \brief Intercept output stream redirection. + ** \param ostr the destination output stream + ** \param loc a reference to the location to redirect + ** + ** Avoid duplicate information. + */ + template + inline std::basic_ostream& + operator<< (std::basic_ostream& ostr, const location& loc) + { + unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0; + ostr << loc.begin; + if (loc.end.filename + && (!loc.begin.filename + || *loc.begin.filename != *loc.end.filename)) + ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col; + else if (loc.begin.line < loc.end.line) + ostr << '-' << loc.end.line << '.' << end_col; + else if (loc.begin.column < end_col) + ostr << '-' << end_col; + return ostr; + } + +#line 14 "dhcp4_parser.yy" // location.cc:296 +} } // isc::dhcp +#line 192 "location.hh" // location.cc:296 +#endif // !YY_PARSER4_LOCATION_HH_INCLUDED diff --git a/src/bin/dhcp4/position.hh b/src/bin/dhcp4/position.hh new file mode 100644 index 0000000000..c60fabbdf8 --- /dev/null +++ b/src/bin/dhcp4/position.hh @@ -0,0 +1,180 @@ +// A Bison parser, made by GNU Bison 3.0.4. + +// Positions for Bison 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 . + +// 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. + +/** + ** \file position.hh + ** Define the isc::dhcp::position class. + */ + +#ifndef YY_PARSER4_POSITION_HH_INCLUDED +# define YY_PARSER4_POSITION_HH_INCLUDED + +# include // std::max +# include +# include + +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif + +#line 14 "dhcp4_parser.yy" // location.cc:296 +namespace isc { namespace dhcp { +#line 56 "position.hh" // location.cc:296 + /// Abstract a position. + class position + { + public: + /// Construct a position. + explicit position (std::string* f = YY_NULLPTR, + unsigned int l = 1u, + unsigned int c = 1u) + : filename (f) + , line (l) + , column (c) + { + } + + + /// Initialization. + void initialize (std::string* fn = YY_NULLPTR, + unsigned int l = 1u, + unsigned int c = 1u) + { + filename = fn; + line = l; + column = c; + } + + /** \name Line and Column related manipulators + ** \{ */ + /// (line related) Advance to the COUNT next lines. + void lines (int count = 1) + { + if (count) + { + column = 1u; + line = add_ (line, count, 1); + } + } + + /// (column related) Advance to the COUNT next columns. + void columns (int count = 1) + { + column = add_ (column, count, 1); + } + /** \} */ + + /// File name to which this position refers. + std::string* filename; + /// Current line number. + unsigned int line; + /// Current column number. + unsigned int column; + + private: + /// Compute max(min, lhs+rhs) (provided min <= lhs). + static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min) + { + return (0 < rhs || -static_cast(rhs) < lhs + ? rhs + lhs + : min); + } + }; + + /// Add \a width columns, in place. + inline position& + operator+= (position& res, int width) + { + res.columns (width); + return res; + } + + /// Add \a width columns. + inline position + operator+ (position res, int width) + { + return res += width; + } + + /// Subtract \a width columns, in place. + inline position& + operator-= (position& res, int width) + { + return res += -width; + } + + /// Subtract \a width columns. + inline position + operator- (position res, int width) + { + return res -= width; + } + + /// Compare two position objects. + inline bool + operator== (const position& pos1, const position& pos2) + { + return (pos1.line == pos2.line + && pos1.column == pos2.column + && (pos1.filename == pos2.filename + || (pos1.filename && pos2.filename + && *pos1.filename == *pos2.filename))); + } + + /// Compare two position objects. + inline bool + operator!= (const position& pos1, const position& pos2) + { + return !(pos1 == pos2); + } + + /** \brief Intercept output stream redirection. + ** \param ostr the destination output stream + ** \param pos a reference to the position to redirect + */ + template + inline std::basic_ostream& + operator<< (std::basic_ostream& ostr, const position& pos) + { + if (pos.filename) + ostr << *pos.filename << ':'; + return ostr << pos.line << '.' << pos.column; + } + +#line 14 "dhcp4_parser.yy" // location.cc:296 +} } // isc::dhcp +#line 180 "position.hh" // location.cc:296 +#endif // !YY_PARSER4_POSITION_HH_INCLUDED diff --git a/src/bin/dhcp4/stack.hh b/src/bin/dhcp4/stack.hh new file mode 100644 index 0000000000..3dd2a2a393 --- /dev/null +++ b/src/bin/dhcp4/stack.hh @@ -0,0 +1,157 @@ +// A Bison parser, made by GNU Bison 3.0.4. + +// Stack handling for Bison 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 . + +// 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. + +/** + ** \file stack.hh + ** Define the isc::dhcp::stack class. + */ + +#ifndef YY_PARSER4_STACK_HH_INCLUDED +# define YY_PARSER4_STACK_HH_INCLUDED + +# include + +#line 14 "dhcp4_parser.yy" // stack.hh:132 +namespace isc { namespace dhcp { +#line 46 "stack.hh" // stack.hh:132 + template > + class stack + { + public: + // Hide our reversed order. + typedef typename S::reverse_iterator iterator; + typedef typename S::const_reverse_iterator const_iterator; + + stack () + : seq_ () + { + seq_.reserve (200); + } + + stack (unsigned int n) + : seq_ (n) + {} + + inline + T& + operator[] (unsigned int i) + { + return seq_[seq_.size () - 1 - i]; + } + + inline + const T& + operator[] (unsigned int i) const + { + return seq_[seq_.size () - 1 - i]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + inline + void + push (T& t) + { + seq_.push_back (T()); + operator[](0).move (t); + } + + inline + void + pop (unsigned int n = 1) + { + for (; n; --n) + seq_.pop_back (); + } + + void + clear () + { + seq_.clear (); + } + + inline + typename S::size_type + size () const + { + return seq_.size (); + } + + inline + const_iterator + begin () const + { + return seq_.rbegin (); + } + + inline + const_iterator + end () const + { + return seq_.rend (); + } + + private: + stack (const stack&); + stack& operator= (const stack&); + /// The wrapped container. + S seq_; + }; + + /// Present a slice of the top of a stack. + template > + class slice + { + public: + slice (const S& stack, unsigned int range) + : stack_ (stack) + , range_ (range) + {} + + inline + const T& + operator [] (unsigned int i) const + { + return stack_[range_ - i]; + } + + private: + const S& stack_; + unsigned int range_; + }; + +#line 14 "dhcp4_parser.yy" // stack.hh:132 +} } // isc::dhcp +#line 156 "stack.hh" // stack.hh:132 + +#endif // !YY_PARSER4_STACK_HH_INCLUDED