From: Francis Dupont Date: Wed, 26 Sep 2018 21:18:19 +0000 (+0000) Subject: [5-netconf-config] regen flex/bison X-Git-Tag: 5-netconf-doc-config_base~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc03ec7fdca03308fb223d67c04ec9b99ba4d3aa;p=thirdparty%2Fkea.git [5-netconf-config] regen flex/bison --- diff --git a/src/bin/netconf/location.hh b/src/bin/netconf/location.hh new file mode 100644 index 0000000000..fcd9de7dd7 --- /dev/null +++ b/src/bin/netconf/location.hh @@ -0,0 +1,190 @@ +// Generated 201809262116 +// A Bison parser, made by GNU Bison 3.0.5. + +// Locations for Bison parsers in C++ + +// Copyright (C) 2002-2015, 2018 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::netconf::location class. + */ + +#ifndef YY_NETCONF_LOCATION_HH_INCLUDED +# define YY_NETCONF_LOCATION_HH_INCLUDED + +# include "position.hh" + +#line 14 "netconf_parser.yy" // location.cc:292 +namespace isc { namespace netconf { +#line 46 "location.hh" // location.cc:292 + /// 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 l = 1u, + unsigned c = 1u) + : begin (f, l, c) + , end (f, l, c) + {} + + + /// Initialization. + void initialize (std::string* f = YY_NULLPTR, + unsigned l = 1u, + unsigned 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 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 "netconf_parser.yy" // location.cc:292 +} } // isc::netconf +#line 189 "location.hh" // location.cc:292 +#endif // !YY_NETCONF_LOCATION_HH_INCLUDED diff --git a/src/bin/netconf/netconf_lexer.cc b/src/bin/netconf/netconf_lexer.cc new file mode 100644 index 0000000000..117c3c5efd --- /dev/null +++ b/src/bin/netconf/netconf_lexer.cc @@ -0,0 +1,3828 @@ +#line 1 "netconf_lexer.cc" + +#line 3 "netconf_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 netconf__create_buffer +#define yy_delete_buffer netconf__delete_buffer +#define yy_scan_buffer netconf__scan_buffer +#define yy_scan_string netconf__scan_string +#define yy_scan_bytes netconf__scan_bytes +#define yy_init_buffer netconf__init_buffer +#define yy_flush_buffer netconf__flush_buffer +#define yy_load_buffer_state netconf__load_buffer_state +#define yy_switch_to_buffer netconf__switch_to_buffer +#define yypush_buffer_state netconf_push_buffer_state +#define yypop_buffer_state netconf_pop_buffer_state +#define yyensure_buffer_stack netconf_ensure_buffer_stack +#define yy_flex_debug netconf__flex_debug +#define yyin netconf_in +#define yyleng netconf_leng +#define yylex netconf_lex +#define yylineno netconf_lineno +#define yyout netconf_out +#define yyrestart netconf_restart +#define yytext netconf_text +#define yywrap netconf_wrap +#define yyalloc netconf_alloc +#define yyrealloc netconf_realloc +#define yyfree netconf_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 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* %if-c++-only */ +/* %endif */ + +/* %if-c-only */ +#ifdef yy_create_buffer +#define netconf__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer netconf__create_buffer +#endif + +#ifdef yy_delete_buffer +#define netconf__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer netconf__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define netconf__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer netconf__scan_buffer +#endif + +#ifdef yy_scan_string +#define netconf__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string netconf__scan_string +#endif + +#ifdef yy_scan_bytes +#define netconf__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes netconf__scan_bytes +#endif + +#ifdef yy_init_buffer +#define netconf__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer netconf__init_buffer +#endif + +#ifdef yy_flush_buffer +#define netconf__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer netconf__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define netconf__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state netconf__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define netconf__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer netconf__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define netconf_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state netconf_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define netconf_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state netconf_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define netconf_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack netconf_ensure_buffer_stack +#endif + +#ifdef yylex +#define netconf_lex_ALREADY_DEFINED +#else +#define yylex netconf_lex +#endif + +#ifdef yyrestart +#define netconf_restart_ALREADY_DEFINED +#else +#define yyrestart netconf_restart +#endif + +#ifdef yylex_init +#define netconf_lex_init_ALREADY_DEFINED +#else +#define yylex_init netconf_lex_init +#endif + +#ifdef yylex_init_extra +#define netconf_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra netconf_lex_init_extra +#endif + +#ifdef yylex_destroy +#define netconf_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy netconf_lex_destroy +#endif + +#ifdef yyget_debug +#define netconf_get_debug_ALREADY_DEFINED +#else +#define yyget_debug netconf_get_debug +#endif + +#ifdef yyset_debug +#define netconf_set_debug_ALREADY_DEFINED +#else +#define yyset_debug netconf_set_debug +#endif + +#ifdef yyget_extra +#define netconf_get_extra_ALREADY_DEFINED +#else +#define yyget_extra netconf_get_extra +#endif + +#ifdef yyset_extra +#define netconf_set_extra_ALREADY_DEFINED +#else +#define yyset_extra netconf_set_extra +#endif + +#ifdef yyget_in +#define netconf_get_in_ALREADY_DEFINED +#else +#define yyget_in netconf_get_in +#endif + +#ifdef yyset_in +#define netconf_set_in_ALREADY_DEFINED +#else +#define yyset_in netconf_set_in +#endif + +#ifdef yyget_out +#define netconf_get_out_ALREADY_DEFINED +#else +#define yyget_out netconf_get_out +#endif + +#ifdef yyset_out +#define netconf_set_out_ALREADY_DEFINED +#else +#define yyset_out netconf_set_out +#endif + +#ifdef yyget_leng +#define netconf_get_leng_ALREADY_DEFINED +#else +#define yyget_leng netconf_get_leng +#endif + +#ifdef yyget_text +#define netconf_get_text_ALREADY_DEFINED +#else +#define yyget_text netconf_get_text +#endif + +#ifdef yyget_lineno +#define netconf_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno netconf_get_lineno +#endif + +#ifdef yyset_lineno +#define netconf_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno netconf_set_lineno +#endif + +#ifdef yywrap +#define netconf_wrap_ALREADY_DEFINED +#else +#define yywrap netconf_wrap +#endif + +/* %endif */ + +#ifdef yyalloc +#define netconf_alloc_ALREADY_DEFINED +#else +#define yyalloc netconf_alloc +#endif + +#ifdef yyrealloc +#define netconf_realloc_ALREADY_DEFINED +#else +#define yyrealloc netconf_realloc +#endif + +#ifdef yyfree +#define netconf_free_ALREADY_DEFINED +#else +#define yyfree netconf_free +#endif + +/* %if-c-only */ + +#ifdef yytext +#define netconf_text_ALREADY_DEFINED +#else +#define yytext netconf_text +#endif + +#ifdef yyleng +#define netconf_leng_ALREADY_DEFINED +#else +#define yyleng netconf_leng +#endif + +#ifdef yyin +#define netconf_in_ALREADY_DEFINED +#else +#define yyin netconf_in +#endif + +#ifdef yyout +#define netconf_out_ALREADY_DEFINED +#else +#define yyout netconf_out +#endif + +#ifdef yy_flex_debug +#define netconf__flex_debug_ALREADY_DEFINED +#else +#define yy_flex_debug netconf__flex_debug +#endif + +#ifdef yylineno +#define netconf_lineno_ALREADY_DEFINED +#else +#define yylineno netconf_lineno +#endif + +/* %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 + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* %endif */ + +/* begin standard C++ headers. */ +/* %if-c++-only */ +/* %endif */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#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 + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_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 yyrestart( yyin ) +#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 int yyleng; +/* %endif */ + +/* %if-c-only */ +/* %if-not-reentrant */ +extern FILE *yyin, *yyout; +/* %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 yytext. */ \ + 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 yytext 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. + */ + int 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 yyrestart()), so that the user can continue scanning by + * just pointing yyin 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 = NULL; /**< 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 yytext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = NULL; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; +/* %ok-for-header */ + +/* %endif */ + +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); + +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); + +/* %endif */ + +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, 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] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ +/* Begin user sect3 */ + +#define netconf_wrap() (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +#define FLEX_DEBUG +typedef flex_uint8_t YY_CHAR; + +FILE *yyin = NULL, *yyout = NULL; + +typedef int yy_state_type; + +extern int yylineno; +int yylineno = 1; + +extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr yytext + +/* %% [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 ); +static void yynoreturn yy_fatal_error ( const char* msg ); + +/* %endif */ + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ +/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\ + yyleng = (int) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ +/* %% [3.0] code to copy yytext_ptr to yytext[] 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 63 +#define YY_END_OF_BUFFER 64 +/* 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 const flex_int16_t yy_accept[340] = + { 0, + 56, 56, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 62, 10, 11, 62, 1, 56, 53, 56, 56, + 62, 55, 54, 62, 62, 62, 62, 62, 49, 50, + 62, 62, 62, 51, 52, 5, 5, 5, 62, 62, + 62, 10, 11, 0, 0, 45, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 56, 56, 0, 55, 56, 3, + 2, 6, 0, 56, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 9, 0, 46, 0, 0, 0, 0, + 0, 0, 48, 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, + 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, + 47, 0, 19, 0, 0, 18, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 61, 59, 0, + 58, 57, 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, 60, 57, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 27, 23, 0, 0, 0, 0, 0, 0, 25, 0, + 0, 28, 0, 0, 26, 22, 0, 0, 0, 0, + 41, 42, 0, 0, 0, 0, 0, 0, 16, 17, + 36, 0, 0, 0, 0, 0, 0, 20, 0, 0, + 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 38, 35, 0, 0, + 0, 24, 0, 0, 0, 32, 12, 14, 0, 0, + 0, 30, 33, 0, 37, 0, 0, 0, 0, 0, + 43, 0, 0, 0, 0, 0, 0, 40, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, + 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 13, 44, 0, 0, + 0, 0, 21, 0, 0, 34, 29, 15, 0 + } ; + +static const 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, 15, + 14, 16, 14, 17, 14, 14, 14, 18, 5, 19, + 5, 20, 21, 5, 22, 23, 24, 25, 26, 27, + 5, 5, 5, 5, 5, 28, 5, 29, 5, 5, + 5, 30, 31, 32, 33, 5, 5, 5, 5, 5, + 34, 35, 36, 5, 37, 5, 38, 39, 40, 41, + + 42, 43, 44, 45, 46, 5, 47, 48, 49, 50, + 51, 52, 5, 53, 54, 55, 56, 57, 5, 58, + 59, 60, 61, 5, 62, 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 const YY_CHAR yy_meta[63] = + { 0, + 1, 1, 2, 3, 3, 4, 3, 3, 3, 3, + 3, 3, 3, 5, 5, 5, 5, 3, 3, 3, + 3, 5, 5, 5, 5, 5, 5, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, + 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3 + } ; + +static const flex_int16_t yy_base[352] = + { 0, + 0, 0, 61, 64, 67, 0, 65, 69, 49, 66, + 284, 2226, 86, 279, 129, 0, 124, 2226, 174, 129, + 84, 180, 2226, 258, 91, 76, 71, 89, 2226, 2226, + 96, 91, 95, 2226, 2226, 2226, 87, 265, 217, 0, + 244, 119, 258, 114, 201, 2226, 207, 217, 224, 231, + 233, 242, 289, 268, 295, 305, 317, 326, 335, 341, + 371, 379, 387, 0, 239, 382, 401, 413, 417, 2226, + 0, 2226, 145, 298, 128, 139, 119, 145, 173, 149, + 2226, 220, 245, 2226, 193, 2226, 429, 401, 443, 451, + 459, 244, 468, 501, 474, 486, 495, 531, 544, 550, + + 556, 562, 570, 580, 586, 592, 610, 617, 628, 636, + 645, 652, 659, 672, 682, 0, 181, 183, 172, 184, + 201, 198, 169, 2226, 0, 694, 702, 713, 720, 162, + 2226, 747, 2226, 730, 740, 2226, 775, 790, 797, 803, + 810, 817, 827, 833, 852, 858, 869, 882, 893, 899, + 907, 917, 929, 937, 947, 954, 215, 2226, 2226, 221, + 2226, 2226, 109, 0, 964, 975, 984, 992, 1030, 1000, + 1023, 1030, 1061, 1078, 1084, 1091, 1097, 1104, 1114, 1127, + 1134, 1142, 1151, 1157, 1172, 1187, 1194, 1200, 1207, 1213, + 1224, 1238, 2226, 2226, 122, 0, 1231, 1244, 1254, 1266, + + 1274, 1282, 1319, 1290, 1296, 1302, 1313, 1320, 1350, 1362, + 2226, 2226, 1368, 1374, 1380, 1388, 1398, 1404, 2226, 1410, + 1428, 2226, 1434, 1440, 2226, 2226, 1451, 109, 0, 1458, + 2226, 2226, 1465, 1475, 1481, 1495, 1501, 1511, 2226, 2226, + 2226, 1519, 1525, 1531, 1537, 1555, 1567, 2226, 1573, 1580, + 1586, 1592, 1598, 2226, 1611, 1617, 1623, 1637, 1653, 1659, + 1672, 1678, 1684, 1690, 1697, 1703, 2226, 2226, 1709, 1715, + 1733, 2226, 1739, 1745, 1752, 2226, 2226, 2226, 1760, 1769, + 1795, 2226, 2226, 1775, 2226, 1806, 1814, 1820, 1830, 1836, + 2226, 1842, 1851, 1860, 1867, 1873, 1881, 2226, 1888, 1904, + + 1916, 1923, 1930, 1939, 1947, 1960, 1969, 1975, 1982, 2226, + 1988, 1995, 2005, 2226, 2012, 2018, 2030, 2036, 2042, 2048, + 2056, 2073, 2084, 2091, 2099, 2108, 2226, 2226, 2114, 2121, + 2129, 2135, 2226, 2144, 2152, 2226, 2226, 2226, 2226, 2187, + 2192, 2197, 2202, 2207, 2212, 2217, 2220, 132, 128, 121, + 111 + } ; + +static const flex_int16_t yy_def[352] = + { 0, + 339, 1, 340, 340, 1, 5, 5, 5, 5, 5, + 339, 339, 339, 339, 341, 342, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 343, + 339, 339, 339, 344, 341, 339, 341, 341, 341, 341, + 345, 341, 341, 341, 341, 341, 341, 341, 341, 341, + 341, 341, 341, 342, 339, 339, 339, 339, 339, 339, + 346, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 343, 339, 344, 339, 339, 341, 341, 341, + 341, 347, 341, 345, 341, 341, 341, 341, 341, 341, + + 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, + 341, 341, 341, 341, 341, 346, 339, 339, 339, 339, + 339, 339, 339, 339, 348, 341, 341, 341, 341, 347, + 339, 345, 339, 341, 341, 339, 341, 341, 341, 341, + 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, + 341, 341, 341, 341, 341, 341, 339, 339, 339, 339, + 339, 339, 339, 349, 341, 341, 341, 341, 345, 341, + 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, + 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, + 341, 341, 339, 339, 339, 350, 341, 341, 341, 341, + + 341, 341, 345, 341, 341, 341, 341, 341, 341, 341, + 339, 339, 341, 341, 341, 341, 341, 341, 339, 341, + 341, 339, 341, 341, 339, 339, 341, 339, 351, 341, + 339, 339, 341, 341, 341, 341, 341, 341, 339, 339, + 339, 341, 341, 341, 341, 341, 341, 339, 341, 341, + 341, 341, 341, 339, 341, 341, 341, 341, 341, 341, + 341, 341, 341, 341, 341, 341, 339, 339, 341, 341, + 341, 339, 341, 341, 341, 339, 339, 339, 341, 341, + 341, 339, 339, 341, 339, 341, 341, 341, 341, 341, + 339, 341, 341, 341, 341, 341, 341, 339, 341, 341, + + 341, 341, 341, 341, 341, 341, 341, 341, 341, 339, + 341, 341, 341, 339, 341, 341, 341, 341, 341, 341, + 341, 341, 341, 341, 341, 341, 339, 339, 341, 341, + 341, 341, 339, 341, 341, 339, 339, 339, 0, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339 + } ; + +static const flex_int16_t yy_nxt[2289] = + { 0, + 12, 13, 14, 13, 12, 15, 16, 12, 17, 18, + 19, 20, 21, 22, 22, 22, 22, 23, 24, 12, + 12, 12, 12, 12, 12, 25, 26, 12, 27, 12, + 12, 28, 12, 29, 12, 30, 12, 12, 12, 12, + 12, 25, 31, 12, 12, 12, 12, 12, 12, 32, + 12, 12, 12, 12, 33, 12, 12, 12, 12, 12, + 34, 35, 37, 14, 37, 37, 14, 37, 38, 41, + 40, 38, 12, 12, 40, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 41, 42, 42, 42, + 42, 70, 12, 12, 12, 12, 71, 75, 12, 73, + + 12, 73, 12, 76, 74, 74, 74, 74, 12, 12, + 12, 12, 39, 75, 12, 85, 12, 75, 77, 86, + 42, 12, 42, 76, 77, 229, 76, 12, 12, 44, + 44, 44, 196, 78, 46, 65, 164, 66, 66, 66, + 66, 77, 69, 69, 69, 69, 79, 80, 87, 67, + 254, 119, 47, 48, 67, 117, 49, 50, 74, 74, + 74, 74, 228, 51, 195, 67, 118, 131, 52, 53, + 67, 54, 117, 55, 119, 117, 56, 57, 58, 59, + 60, 119, 61, 62, 63, 65, 118, 68, 68, 68, + 68, 65, 120, 68, 68, 68, 68, 159, 86, 67, + + 118, 44, 44, 44, 122, 67, 46, 44, 44, 44, + 158, 157, 46, 159, 157, 67, 163, 44, 44, 44, + 121, 67, 46, 159, 44, 44, 44, 87, 158, 46, + 158, 44, 44, 44, 157, 51, 46, 160, 93, 162, + 193, 51, 44, 44, 44, 45, 193, 46, 161, 131, + 124, 51, 69, 69, 69, 69, 193, 88, 51, 123, + 43, 89, 194, 84, 67, 51, 82, 45, 44, 44, + 44, 45, 91, 46, 90, 45, 51, 81, 72, 95, + 67, 43, 45, 339, 339, 45, 339, 45, 94, 44, + 44, 44, 96, 339, 46, 44, 44, 44, 339, 339, + + 46, 339, 51, 97, 339, 44, 44, 44, 339, 339, + 46, 74, 74, 74, 74, 100, 339, 44, 44, 44, + 339, 339, 46, 51, 339, 339, 44, 44, 44, 51, + 98, 46, 339, 99, 339, 44, 44, 44, 339, 51, + 46, 44, 44, 44, 339, 101, 46, 339, 339, 102, + 103, 51, 339, 339, 105, 104, 339, 339, 339, 339, + 51, 339, 339, 107, 339, 339, 339, 106, 339, 51, + 339, 44, 44, 44, 339, 51, 46, 339, 109, 44, + 44, 44, 339, 339, 46, 339, 339, 44, 44, 44, + 108, 110, 46, 65, 339, 66, 66, 66, 66, 339, + + 339, 44, 44, 44, 339, 51, 46, 67, 339, 73, + 339, 73, 111, 51, 74, 74, 74, 74, 339, 339, + 339, 51, 339, 67, 65, 112, 68, 68, 68, 68, + 69, 69, 69, 69, 85, 51, 114, 113, 67, 339, + 115, 85, 67, 44, 44, 44, 339, 339, 46, 339, + 126, 44, 44, 44, 67, 339, 46, 339, 67, 44, + 44, 44, 339, 85, 46, 339, 339, 85, 44, 44, + 44, 85, 339, 46, 44, 44, 44, 51, 85, 133, + 339, 85, 127, 85, 125, 51, 44, 44, 44, 339, + 339, 46, 339, 51, 128, 44, 44, 44, 339, 339, + + 136, 339, 51, 339, 339, 339, 339, 339, 51, 339, + 339, 339, 339, 129, 132, 132, 132, 132, 339, 339, + 51, 339, 132, 132, 132, 132, 132, 132, 339, 51, + 339, 44, 44, 44, 134, 135, 46, 339, 132, 132, + 132, 132, 132, 132, 44, 44, 44, 339, 339, 46, + 44, 44, 44, 339, 339, 46, 44, 44, 44, 339, + 339, 46, 44, 44, 44, 51, 339, 46, 339, 137, + 44, 44, 44, 339, 339, 46, 339, 339, 51, 339, + 44, 44, 44, 138, 51, 46, 44, 44, 44, 339, + 51, 46, 44, 44, 44, 339, 51, 46, 339, 339, + + 339, 339, 339, 339, 51, 139, 140, 339, 143, 141, + 44, 44, 44, 339, 51, 46, 142, 44, 44, 44, + 51, 339, 46, 144, 339, 339, 51, 339, 44, 44, + 44, 339, 147, 46, 339, 145, 44, 44, 44, 339, + 339, 46, 339, 146, 51, 44, 44, 44, 339, 339, + 46, 51, 44, 44, 44, 339, 339, 46, 148, 44, + 44, 44, 51, 339, 46, 339, 339, 339, 339, 339, + 51, 149, 44, 44, 44, 339, 339, 46, 339, 51, + 150, 339, 44, 44, 44, 339, 51, 46, 151, 339, + 339, 339, 153, 51, 44, 44, 44, 339, 339, 46, + + 339, 152, 44, 44, 44, 339, 51, 46, 339, 339, + 154, 339, 339, 44, 44, 44, 51, 155, 46, 339, + 44, 44, 44, 156, 339, 46, 339, 339, 51, 339, + 44, 44, 44, 339, 339, 46, 51, 339, 339, 339, + 44, 44, 44, 339, 339, 46, 339, 51, 165, 339, + 339, 339, 339, 166, 51, 339, 167, 339, 339, 168, + 169, 169, 169, 169, 51, 339, 339, 339, 169, 169, + 169, 169, 169, 169, 51, 44, 44, 44, 170, 339, + 46, 339, 339, 339, 169, 169, 169, 169, 169, 169, + 44, 44, 44, 339, 171, 46, 339, 44, 44, 44, + + 339, 339, 46, 44, 44, 44, 339, 339, 46, 51, + 44, 44, 44, 339, 339, 46, 339, 44, 44, 44, + 339, 339, 46, 339, 51, 339, 339, 44, 44, 44, + 172, 51, 46, 44, 44, 44, 339, 51, 46, 339, + 339, 173, 339, 339, 51, 339, 339, 339, 339, 175, + 174, 51, 44, 44, 44, 339, 339, 46, 44, 44, + 44, 51, 339, 46, 176, 339, 339, 51, 177, 44, + 44, 44, 339, 339, 46, 339, 179, 339, 339, 178, + 339, 339, 44, 44, 44, 339, 51, 46, 339, 180, + 339, 339, 51, 44, 44, 44, 339, 339, 46, 44, + + 44, 44, 339, 51, 46, 339, 339, 44, 44, 44, + 183, 181, 46, 339, 182, 339, 51, 44, 44, 44, + 339, 339, 46, 184, 339, 339, 339, 51, 339, 44, + 44, 44, 339, 51, 46, 339, 186, 44, 44, 44, + 339, 51, 46, 339, 185, 339, 339, 44, 44, 44, + 339, 51, 46, 339, 44, 44, 44, 339, 188, 46, + 339, 187, 339, 51, 44, 44, 44, 339, 339, 46, + 339, 51, 339, 339, 339, 44, 44, 44, 190, 189, + 46, 51, 339, 339, 44, 44, 44, 339, 51, 46, + 198, 199, 44, 44, 44, 339, 339, 46, 51, 200, + + 44, 44, 44, 339, 191, 46, 192, 339, 339, 51, + 339, 339, 339, 339, 339, 339, 197, 339, 51, 339, + 339, 339, 339, 44, 44, 44, 51, 339, 46, 201, + 44, 44, 44, 339, 51, 46, 339, 339, 339, 339, + 339, 204, 202, 203, 203, 203, 203, 339, 339, 339, + 339, 203, 203, 203, 203, 203, 203, 51, 339, 339, + 339, 44, 44, 44, 51, 339, 46, 203, 203, 203, + 203, 203, 203, 206, 339, 205, 207, 208, 44, 44, + 44, 339, 339, 46, 44, 44, 44, 339, 339, 46, + 339, 44, 44, 44, 339, 51, 211, 44, 44, 44, + + 339, 339, 212, 339, 44, 44, 44, 339, 339, 46, + 339, 339, 51, 339, 44, 44, 44, 339, 51, 46, + 339, 339, 209, 339, 339, 51, 339, 44, 44, 44, + 339, 51, 46, 339, 44, 44, 44, 210, 51, 46, + 339, 213, 44, 44, 44, 339, 339, 46, 51, 339, + 339, 44, 44, 44, 339, 214, 46, 44, 44, 44, + 339, 51, 219, 339, 339, 339, 339, 339, 51, 339, + 215, 339, 44, 44, 44, 339, 51, 46, 339, 216, + 339, 339, 339, 217, 339, 51, 339, 44, 44, 44, + 339, 51, 46, 339, 44, 44, 44, 339, 218, 222, + + 44, 44, 44, 339, 339, 46, 51, 44, 44, 44, + 339, 339, 46, 44, 44, 44, 339, 339, 225, 339, + 339, 51, 339, 339, 44, 44, 44, 220, 51, 226, + 339, 44, 44, 44, 51, 221, 46, 339, 44, 44, + 44, 51, 339, 46, 44, 44, 44, 51, 227, 231, + 339, 339, 223, 339, 44, 44, 44, 339, 51, 232, + 339, 339, 224, 339, 339, 51, 44, 44, 44, 339, + 339, 46, 51, 339, 44, 44, 44, 339, 51, 46, + 339, 230, 44, 44, 44, 339, 339, 46, 51, 339, + 44, 44, 44, 339, 339, 46, 44, 44, 44, 339, + + 51, 46, 44, 44, 44, 339, 233, 46, 51, 339, + 339, 339, 339, 44, 44, 44, 51, 339, 239, 339, + 44, 44, 44, 234, 51, 240, 339, 339, 339, 339, + 51, 235, 45, 45, 45, 45, 51, 339, 339, 236, + 45, 45, 45, 45, 45, 45, 237, 51, 339, 238, + 44, 44, 44, 339, 51, 241, 45, 45, 45, 45, + 45, 45, 44, 44, 44, 339, 339, 46, 44, 44, + 44, 339, 242, 46, 44, 44, 44, 339, 339, 46, + 44, 44, 44, 339, 51, 46, 339, 339, 44, 44, + 44, 339, 339, 46, 339, 339, 51, 339, 44, 44, + + 44, 339, 51, 46, 44, 44, 44, 339, 51, 248, + 44, 44, 44, 339, 51, 46, 339, 339, 339, 339, + 243, 245, 51, 339, 339, 339, 244, 339, 44, 44, + 44, 339, 51, 46, 44, 44, 44, 339, 51, 46, + 44, 44, 44, 339, 51, 46, 339, 246, 339, 339, + 247, 44, 44, 44, 339, 339, 46, 339, 44, 44, + 44, 339, 51, 46, 249, 44, 44, 44, 51, 250, + 46, 339, 339, 339, 51, 44, 44, 44, 339, 251, + 46, 44, 44, 44, 339, 51, 46, 339, 339, 339, + 253, 339, 51, 339, 252, 44, 44, 44, 339, 51, + + 46, 44, 44, 44, 339, 255, 46, 339, 339, 51, + 339, 44, 44, 44, 256, 51, 46, 339, 257, 44, + 44, 44, 339, 258, 46, 44, 44, 44, 339, 51, + 46, 44, 44, 44, 339, 51, 46, 44, 44, 44, + 339, 339, 46, 339, 339, 51, 339, 339, 260, 259, + 339, 339, 261, 51, 339, 44, 44, 44, 339, 51, + 46, 339, 339, 339, 339, 51, 262, 44, 44, 44, + 339, 51, 267, 44, 44, 44, 339, 265, 268, 339, + 44, 44, 44, 263, 264, 46, 44, 44, 44, 51, + 339, 46, 44, 44, 44, 339, 266, 272, 44, 44, + + 44, 51, 339, 46, 339, 339, 339, 51, 339, 269, + 339, 44, 44, 44, 51, 339, 46, 44, 44, 44, + 51, 274, 46, 44, 44, 44, 51, 339, 276, 339, + 339, 339, 51, 339, 270, 339, 339, 44, 44, 44, + 271, 339, 277, 339, 339, 51, 339, 339, 273, 339, + 339, 51, 339, 44, 44, 44, 339, 51, 278, 44, + 44, 44, 339, 339, 46, 339, 339, 339, 339, 279, + 275, 51, 44, 44, 44, 339, 339, 46, 44, 44, + 44, 339, 339, 46, 44, 44, 44, 51, 339, 282, + 44, 44, 44, 51, 339, 283, 339, 44, 44, 44, + + 339, 339, 46, 44, 44, 44, 51, 284, 285, 44, + 44, 44, 51, 339, 46, 44, 44, 44, 51, 339, + 46, 339, 339, 281, 51, 339, 339, 339, 280, 339, + 339, 51, 339, 44, 44, 44, 339, 51, 46, 44, + 44, 44, 339, 51, 46, 44, 44, 44, 339, 51, + 46, 339, 44, 44, 44, 339, 287, 291, 339, 286, + 44, 44, 44, 339, 339, 46, 339, 51, 339, 44, + 44, 44, 339, 51, 46, 44, 44, 44, 339, 51, + 46, 339, 290, 339, 339, 339, 51, 339, 289, 339, + 339, 288, 339, 339, 51, 44, 44, 44, 339, 339, + + 46, 339, 339, 51, 339, 339, 44, 44, 44, 51, + 293, 46, 339, 292, 44, 44, 44, 339, 339, 46, + 44, 44, 44, 339, 339, 298, 339, 339, 295, 51, + 44, 44, 44, 294, 339, 46, 44, 44, 44, 339, + 51, 46, 44, 44, 44, 339, 339, 46, 51, 339, + 339, 44, 44, 44, 51, 339, 46, 296, 339, 339, + 44, 44, 44, 339, 51, 46, 297, 44, 44, 44, + 51, 339, 46, 44, 44, 44, 51, 339, 46, 300, + 339, 44, 44, 44, 299, 51, 46, 339, 44, 44, + 44, 339, 301, 46, 51, 339, 339, 339, 302, 339, + + 339, 51, 339, 339, 44, 44, 44, 51, 304, 46, + 339, 339, 303, 339, 339, 51, 44, 44, 44, 339, + 339, 46, 51, 44, 44, 44, 339, 305, 310, 307, + 44, 44, 44, 339, 306, 46, 339, 339, 51, 44, + 44, 44, 339, 339, 46, 308, 339, 44, 44, 44, + 51, 339, 46, 339, 339, 309, 339, 51, 339, 339, + 44, 44, 44, 339, 51, 314, 339, 311, 339, 44, + 44, 44, 339, 51, 46, 44, 44, 44, 339, 339, + 46, 51, 44, 44, 44, 339, 339, 46, 44, 44, + 44, 312, 313, 46, 51, 44, 44, 44, 339, 339, + + 46, 339, 339, 51, 339, 44, 44, 44, 339, 51, + 46, 339, 44, 44, 44, 339, 51, 46, 44, 44, + 44, 339, 51, 46, 316, 339, 315, 339, 317, 51, + 44, 44, 44, 339, 339, 46, 44, 44, 44, 51, + 318, 46, 44, 44, 44, 339, 51, 46, 44, 44, + 44, 319, 51, 46, 339, 320, 44, 44, 44, 339, + 339, 327, 339, 339, 51, 339, 321, 339, 339, 339, + 51, 323, 322, 44, 44, 44, 51, 339, 328, 339, + 339, 324, 51, 325, 44, 44, 44, 339, 339, 46, + 51, 44, 44, 44, 339, 339, 46, 326, 339, 44, + + 44, 44, 339, 339, 46, 339, 339, 51, 44, 44, + 44, 339, 339, 46, 44, 44, 44, 339, 51, 333, + 339, 44, 44, 44, 339, 51, 46, 339, 339, 44, + 44, 44, 330, 51, 46, 44, 44, 44, 329, 339, + 336, 339, 51, 339, 44, 44, 44, 339, 51, 337, + 339, 331, 44, 44, 44, 51, 339, 338, 339, 339, + 339, 332, 339, 51, 339, 339, 339, 339, 339, 51, + 339, 339, 339, 339, 334, 339, 339, 339, 51, 339, + 339, 339, 335, 339, 339, 339, 51, 36, 36, 36, + 36, 36, 45, 45, 45, 45, 45, 64, 339, 64, + + 64, 64, 83, 339, 83, 339, 83, 85, 85, 85, + 85, 85, 92, 92, 92, 92, 92, 116, 339, 116, + 116, 116, 130, 130, 130, 11, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339 + } ; + +static const flex_int16_t yy_chk[2289] = + { 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, 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, 5, 10, 13, 37, 13, + 37, 21, 5, 5, 9, 5, 21, 26, 5, 25, + + 5, 25, 5, 27, 25, 25, 25, 25, 5, 5, + 7, 10, 5, 26, 8, 351, 5, 31, 28, 44, + 42, 5, 42, 32, 33, 350, 27, 5, 5, 15, + 15, 15, 349, 31, 15, 17, 348, 17, 17, 17, + 17, 28, 20, 20, 20, 20, 32, 33, 44, 17, + 228, 77, 15, 15, 20, 75, 15, 15, 73, 73, + 73, 73, 195, 15, 163, 17, 76, 130, 15, 15, + 20, 15, 78, 15, 77, 75, 15, 15, 15, 15, + 15, 80, 15, 15, 15, 19, 76, 19, 19, 19, + 19, 22, 78, 22, 22, 22, 22, 119, 85, 19, + + 79, 45, 45, 45, 80, 22, 45, 47, 47, 47, + 118, 117, 47, 119, 120, 19, 123, 48, 48, 48, + 79, 22, 48, 122, 49, 49, 49, 85, 121, 49, + 118, 50, 50, 50, 117, 45, 50, 120, 51, 122, + 157, 47, 52, 52, 52, 51, 160, 52, 121, 92, + 83, 48, 65, 65, 65, 65, 157, 47, 49, 82, + 43, 48, 160, 41, 65, 50, 39, 51, 54, 54, + 54, 51, 50, 54, 49, 51, 52, 38, 24, 52, + 65, 14, 51, 11, 0, 51, 0, 51, 51, 53, + 53, 53, 52, 0, 53, 55, 55, 55, 0, 0, + + 55, 0, 54, 53, 0, 56, 56, 56, 0, 0, + 56, 74, 74, 74, 74, 54, 0, 57, 57, 57, + 0, 0, 57, 53, 0, 0, 58, 58, 58, 55, + 53, 58, 0, 53, 0, 59, 59, 59, 0, 56, + 59, 60, 60, 60, 0, 55, 60, 0, 0, 55, + 56, 57, 0, 0, 57, 56, 0, 0, 0, 0, + 58, 0, 0, 58, 0, 0, 0, 57, 0, 59, + 0, 61, 61, 61, 0, 60, 61, 0, 60, 62, + 62, 62, 0, 0, 62, 0, 0, 63, 63, 63, + 59, 60, 63, 66, 0, 66, 66, 66, 66, 0, + + 0, 88, 88, 88, 0, 61, 88, 66, 0, 67, + 0, 67, 61, 62, 67, 67, 67, 67, 0, 0, + 0, 63, 0, 66, 68, 61, 68, 68, 68, 68, + 69, 69, 69, 69, 87, 88, 63, 62, 68, 0, + 63, 87, 69, 89, 89, 89, 0, 0, 89, 0, + 88, 90, 90, 90, 68, 0, 90, 0, 69, 91, + 91, 91, 0, 87, 91, 0, 0, 87, 93, 93, + 93, 87, 0, 93, 95, 95, 95, 89, 87, 95, + 0, 87, 89, 87, 87, 90, 96, 96, 96, 0, + 0, 96, 0, 91, 90, 97, 97, 97, 0, 0, + + 97, 0, 93, 0, 0, 0, 0, 0, 95, 0, + 0, 0, 0, 91, 94, 94, 94, 94, 0, 0, + 96, 0, 94, 94, 94, 94, 94, 94, 0, 97, + 0, 98, 98, 98, 96, 96, 98, 0, 94, 94, + 94, 94, 94, 94, 99, 99, 99, 0, 0, 99, + 100, 100, 100, 0, 0, 100, 101, 101, 101, 0, + 0, 101, 102, 102, 102, 98, 0, 102, 0, 98, + 103, 103, 103, 0, 0, 103, 0, 0, 99, 0, + 104, 104, 104, 99, 100, 104, 105, 105, 105, 0, + 101, 105, 106, 106, 106, 0, 102, 106, 0, 0, + + 0, 0, 0, 0, 103, 100, 101, 0, 103, 101, + 107, 107, 107, 0, 104, 107, 102, 108, 108, 108, + 105, 0, 108, 104, 0, 0, 106, 0, 109, 109, + 109, 0, 106, 109, 0, 105, 110, 110, 110, 0, + 0, 110, 0, 105, 107, 111, 111, 111, 0, 0, + 111, 108, 112, 112, 112, 0, 0, 112, 107, 113, + 113, 113, 109, 0, 113, 0, 0, 0, 0, 0, + 110, 108, 114, 114, 114, 0, 0, 114, 0, 111, + 109, 0, 115, 115, 115, 0, 112, 115, 110, 0, + 0, 0, 112, 113, 126, 126, 126, 0, 0, 126, + + 0, 111, 127, 127, 127, 0, 114, 127, 0, 0, + 113, 0, 0, 128, 128, 128, 115, 114, 128, 0, + 129, 129, 129, 115, 0, 129, 0, 0, 126, 0, + 134, 134, 134, 0, 0, 134, 127, 0, 0, 0, + 135, 135, 135, 0, 0, 135, 0, 128, 126, 0, + 0, 0, 0, 127, 129, 0, 128, 0, 0, 129, + 132, 132, 132, 132, 134, 0, 0, 0, 132, 132, + 132, 132, 132, 132, 135, 137, 137, 137, 134, 0, + 137, 0, 0, 0, 132, 132, 132, 132, 132, 132, + 138, 138, 138, 0, 135, 138, 0, 139, 139, 139, + + 0, 0, 139, 140, 140, 140, 0, 0, 140, 137, + 141, 141, 141, 0, 0, 141, 0, 142, 142, 142, + 0, 0, 142, 0, 138, 0, 0, 143, 143, 143, + 137, 139, 143, 144, 144, 144, 0, 140, 144, 0, + 0, 138, 0, 0, 141, 0, 0, 0, 0, 140, + 139, 142, 145, 145, 145, 0, 0, 145, 146, 146, + 146, 143, 0, 146, 141, 0, 0, 144, 142, 147, + 147, 147, 0, 0, 147, 0, 144, 0, 0, 143, + 0, 0, 148, 148, 148, 0, 145, 148, 0, 145, + 0, 0, 146, 149, 149, 149, 0, 0, 149, 150, + + 150, 150, 0, 147, 150, 0, 0, 151, 151, 151, + 147, 146, 151, 0, 146, 0, 148, 152, 152, 152, + 0, 0, 152, 148, 0, 0, 0, 149, 0, 153, + 153, 153, 0, 150, 153, 0, 150, 154, 154, 154, + 0, 151, 154, 0, 149, 0, 0, 155, 155, 155, + 0, 152, 155, 0, 156, 156, 156, 0, 152, 156, + 0, 151, 0, 153, 165, 165, 165, 0, 0, 165, + 0, 154, 0, 0, 0, 166, 166, 166, 154, 153, + 166, 155, 0, 0, 167, 167, 167, 0, 156, 167, + 166, 166, 168, 168, 168, 0, 0, 168, 165, 166, + + 170, 170, 170, 0, 155, 170, 156, 0, 0, 166, + 0, 0, 0, 0, 0, 0, 165, 0, 167, 0, + 0, 0, 0, 171, 171, 171, 168, 0, 171, 167, + 172, 172, 172, 0, 170, 172, 0, 0, 0, 0, + 0, 170, 168, 169, 169, 169, 169, 0, 0, 0, + 0, 169, 169, 169, 169, 169, 169, 171, 0, 0, + 0, 173, 173, 173, 172, 0, 173, 169, 169, 169, + 169, 169, 169, 172, 0, 171, 173, 173, 174, 174, + 174, 0, 0, 174, 175, 175, 175, 0, 0, 175, + 0, 176, 176, 176, 0, 173, 176, 177, 177, 177, + + 0, 0, 177, 0, 178, 178, 178, 0, 0, 178, + 0, 0, 174, 0, 179, 179, 179, 0, 175, 179, + 0, 0, 174, 0, 0, 176, 0, 180, 180, 180, + 0, 177, 180, 0, 181, 181, 181, 175, 178, 181, + 0, 178, 182, 182, 182, 0, 0, 182, 179, 0, + 0, 183, 183, 183, 0, 179, 183, 184, 184, 184, + 0, 180, 184, 0, 0, 0, 0, 0, 181, 0, + 180, 0, 185, 185, 185, 0, 182, 185, 0, 181, + 0, 0, 0, 182, 0, 183, 0, 186, 186, 186, + 0, 184, 186, 0, 187, 187, 187, 0, 183, 187, + + 188, 188, 188, 0, 0, 188, 185, 189, 189, 189, + 0, 0, 189, 190, 190, 190, 0, 0, 190, 0, + 0, 186, 0, 0, 191, 191, 191, 185, 187, 191, + 0, 197, 197, 197, 188, 186, 197, 0, 192, 192, + 192, 189, 0, 192, 198, 198, 198, 190, 192, 198, + 0, 0, 188, 0, 199, 199, 199, 0, 191, 199, + 0, 0, 189, 0, 0, 197, 200, 200, 200, 0, + 0, 200, 192, 0, 201, 201, 201, 0, 198, 201, + 0, 197, 202, 202, 202, 0, 0, 202, 199, 0, + 204, 204, 204, 0, 0, 204, 205, 205, 205, 0, + + 200, 205, 206, 206, 206, 0, 200, 206, 201, 0, + 0, 0, 0, 207, 207, 207, 202, 0, 207, 0, + 208, 208, 208, 201, 204, 208, 0, 0, 0, 0, + 205, 202, 203, 203, 203, 203, 206, 0, 0, 204, + 203, 203, 203, 203, 203, 203, 205, 207, 0, 206, + 209, 209, 209, 0, 208, 209, 203, 203, 203, 203, + 203, 203, 210, 210, 210, 0, 0, 210, 213, 213, + 213, 0, 210, 213, 214, 214, 214, 0, 0, 214, + 215, 215, 215, 0, 209, 215, 0, 0, 216, 216, + 216, 0, 0, 216, 0, 0, 210, 0, 217, 217, + + 217, 0, 213, 217, 218, 218, 218, 0, 214, 218, + 220, 220, 220, 0, 215, 220, 0, 0, 0, 0, + 213, 215, 216, 0, 0, 0, 214, 0, 221, 221, + 221, 0, 217, 221, 223, 223, 223, 0, 218, 223, + 224, 224, 224, 0, 220, 224, 0, 216, 0, 0, + 217, 227, 227, 227, 0, 0, 227, 0, 230, 230, + 230, 0, 221, 230, 220, 233, 233, 233, 223, 221, + 233, 0, 0, 0, 224, 234, 234, 234, 0, 223, + 234, 235, 235, 235, 0, 227, 235, 0, 0, 0, + 227, 0, 230, 0, 224, 236, 236, 236, 0, 233, + + 236, 237, 237, 237, 0, 230, 237, 0, 0, 234, + 0, 238, 238, 238, 233, 235, 238, 0, 234, 242, + 242, 242, 0, 235, 242, 243, 243, 243, 0, 236, + 243, 244, 244, 244, 0, 237, 244, 245, 245, 245, + 0, 0, 245, 0, 0, 238, 0, 0, 237, 236, + 0, 0, 238, 242, 0, 246, 246, 246, 0, 243, + 246, 0, 0, 0, 0, 244, 242, 247, 247, 247, + 0, 245, 247, 249, 249, 249, 0, 245, 249, 0, + 250, 250, 250, 243, 244, 250, 251, 251, 251, 246, + 0, 251, 252, 252, 252, 0, 246, 252, 253, 253, + + 253, 247, 0, 253, 0, 0, 0, 249, 0, 249, + 0, 255, 255, 255, 250, 0, 255, 256, 256, 256, + 251, 255, 256, 257, 257, 257, 252, 0, 257, 0, + 0, 0, 253, 0, 250, 0, 0, 258, 258, 258, + 251, 0, 258, 0, 0, 255, 0, 0, 253, 0, + 0, 256, 0, 259, 259, 259, 0, 257, 259, 260, + 260, 260, 0, 0, 260, 0, 0, 0, 0, 260, + 256, 258, 261, 261, 261, 0, 0, 261, 262, 262, + 262, 0, 0, 262, 263, 263, 263, 259, 0, 263, + 264, 264, 264, 260, 0, 264, 0, 265, 265, 265, + + 0, 0, 265, 266, 266, 266, 261, 265, 266, 269, + 269, 269, 262, 0, 269, 270, 270, 270, 263, 0, + 270, 0, 0, 262, 264, 0, 0, 0, 261, 0, + 0, 265, 0, 271, 271, 271, 0, 266, 271, 273, + 273, 273, 0, 269, 273, 274, 274, 274, 0, 270, + 274, 0, 275, 275, 275, 0, 270, 275, 0, 269, + 279, 279, 279, 0, 0, 279, 0, 271, 0, 280, + 280, 280, 0, 273, 280, 284, 284, 284, 0, 274, + 284, 0, 274, 0, 0, 0, 275, 0, 273, 0, + 0, 271, 0, 0, 279, 281, 281, 281, 0, 0, + + 281, 0, 0, 280, 0, 0, 286, 286, 286, 284, + 280, 286, 0, 279, 287, 287, 287, 0, 0, 287, + 288, 288, 288, 0, 0, 288, 0, 0, 284, 281, + 289, 289, 289, 281, 0, 289, 290, 290, 290, 0, + 286, 290, 292, 292, 292, 0, 0, 292, 287, 0, + 0, 293, 293, 293, 288, 0, 293, 286, 0, 0, + 294, 294, 294, 0, 289, 294, 287, 295, 295, 295, + 290, 0, 295, 296, 296, 296, 292, 0, 296, 290, + 0, 297, 297, 297, 289, 293, 297, 0, 299, 299, + 299, 0, 292, 299, 294, 0, 0, 0, 293, 0, + + 0, 295, 0, 0, 300, 300, 300, 296, 295, 300, + 0, 0, 294, 0, 0, 297, 301, 301, 301, 0, + 0, 301, 299, 302, 302, 302, 0, 296, 302, 299, + 303, 303, 303, 0, 297, 303, 0, 0, 300, 304, + 304, 304, 0, 0, 304, 300, 0, 305, 305, 305, + 301, 0, 305, 0, 0, 301, 0, 302, 0, 0, + 306, 306, 306, 0, 303, 306, 0, 303, 0, 307, + 307, 307, 0, 304, 307, 308, 308, 308, 0, 0, + 308, 305, 309, 309, 309, 0, 0, 309, 311, 311, + 311, 304, 305, 311, 306, 312, 312, 312, 0, 0, + + 312, 0, 0, 307, 0, 313, 313, 313, 0, 308, + 313, 0, 315, 315, 315, 0, 309, 315, 316, 316, + 316, 0, 311, 316, 308, 0, 307, 0, 309, 312, + 317, 317, 317, 0, 0, 317, 318, 318, 318, 313, + 311, 318, 319, 319, 319, 0, 315, 319, 320, 320, + 320, 312, 316, 320, 0, 313, 321, 321, 321, 0, + 0, 321, 0, 0, 317, 0, 315, 0, 0, 0, + 318, 317, 316, 322, 322, 322, 319, 0, 322, 0, + 0, 318, 320, 319, 323, 323, 323, 0, 0, 323, + 321, 324, 324, 324, 0, 0, 324, 320, 0, 325, + + 325, 325, 0, 0, 325, 0, 0, 322, 326, 326, + 326, 0, 0, 326, 329, 329, 329, 0, 323, 329, + 0, 330, 330, 330, 0, 324, 330, 0, 0, 331, + 331, 331, 324, 325, 331, 332, 332, 332, 323, 0, + 332, 0, 326, 0, 334, 334, 334, 0, 329, 334, + 0, 325, 335, 335, 335, 330, 0, 335, 0, 0, + 0, 326, 0, 331, 0, 0, 0, 0, 0, 332, + 0, 0, 0, 0, 330, 0, 0, 0, 334, 0, + 0, 0, 331, 0, 0, 0, 335, 340, 340, 340, + 340, 340, 341, 341, 341, 341, 341, 342, 0, 342, + + 342, 342, 343, 0, 343, 0, 343, 344, 344, 344, + 344, 344, 345, 345, 345, 345, 345, 346, 0, 346, + 346, 346, 347, 347, 347, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int yy_flex_debug; +int yy_flex_debug = 1; + +static const flex_int16_t yy_rule_linenum[63] = + { 0, + 133, 135, 137, 142, 143, 148, 149, 150, 162, 165, + 170, 177, 186, 198, 210, 219, 228, 237, 246, 255, + 264, 273, 282, 291, 300, 310, 319, 328, 337, 346, + 355, 364, 373, 382, 391, 400, 409, 418, 427, 436, + 445, 454, 463, 472, 481, 580, 585, 590, 595, 596, + 597, 598, 599, 600, 602, 620, 633, 638, 642, 644, + 646, 648 + } ; + +/* 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 *yytext; +#line 1 "netconf_lexer.ll" +/* Copyright (C) 2018 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 "netconf_lexer.ll" + +/* Generated files do not make clang static analyser so happy */ +#ifndef __clang_analyzer__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Please avoid C++ style comments (// ... eol) as they break flex 2.6.2 */ + +/* 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 yywrap +# define yywrap() 1 + +namespace { + +bool start_token_flag = false; + +isc::netconf::ParserContext::ParserType start_token_value; +unsigned int comment_start_line = 0; + +using namespace isc; +using isc::netconf::NetconfParser; + +}; + +/* To avoid the call to exit... oops! */ +#define YY_FATAL_ERROR(msg) isc::netconf::ParserContext::fatal(msg) +#line 1452 "netconf_lexer.cc" +/* 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 yywrap requires linking with -lfl, which provides the default yywrap + 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 + yy_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 96 "netconf_lexer.ll" +/* This code run each time a pattern is matched. It updates the location + by moving it ahead by yyleng bytes. yyleng specifies the length of the + currently matched token. */ +#define YY_USER_ACTION driver.loc_.columns(yyleng); +#line 1478 "netconf_lexer.cc" +#line 1479 "netconf_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 yylex_destroy ( void ); + +int yyget_debug ( void ); + +void yyset_debug ( int debug_flag ); + +YY_EXTRA_TYPE yyget_extra ( void ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in ( void ); + +void yyset_in ( FILE * _in_str ); + +FILE *yyget_out ( void ); + +void yyset_out ( FILE * _out_str ); + + int yyget_leng ( void ); + +char *yyget_text ( void ); + +int yyget_lineno ( void ); + +void yyset_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 yywrap ( void ); +#else +extern int yywrap ( void ); +#endif +#endif + +/* %not-for-header */ +#ifndef YY_NO_UNPUT + +#endif +/* %ok-for-header */ + +/* %endif */ + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const 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( yytext, (size_t) yyleng, 1, yyout )) {} } 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 = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ +/* %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 yylex (void); + +#define YY_DECL int yylex (void) +/* %endif */ +/* %if-c++-only C++ definition */ +/* %endif */ +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * 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 ( ! yyin ) +/* %if-c-only */ + yyin = stdin; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + + if ( ! yyout ) +/* %if-c-only */ + yyout = stdout; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + { +/* %% [7.0] user's declarations go here */ +#line 102 "netconf_lexer.ll" + + + +#line 106 "netconf_lexer.ll" + /* This part of the code is copied over to the verbatim to the top + of the generated yylex function. Explanation: + http://www.gnu.org/software/bison/manual/html_node/Multiple-start_002dsymbols.html */ + + /* Code run each time yylex is called. */ + driver.loc_.step(); + + /* We currently have 3 points of entries defined: + START_JSON - which expects any valid JSON + START_NETCONF - which expects full configuration (with outer map and Control-netconf + object in it. + START_SUB_NETCONF - which expects only content of the Control-netconf, this is + primarily useful for testing. */ + if (start_token_flag) { + start_token_flag = false; + switch (start_token_value) { + case ParserContext::PARSER_JSON: + default: + return NetconfParser::make_START_JSON(driver.loc_); + case ParserContext::PARSER_NETCONF: + return NetconfParser::make_START_NETCONF(driver.loc_); + case ParserContext::PARSER_SUB_NETCONF: + return NetconfParser::make_START_SUB_NETCONF(driver.loc_); + } + } + + +#line 1793 "netconf_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 yytext. */ + *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 >= 340 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 339 ); + 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 yylineno update goes here */ + +do_action: /* This label is used only to access EOF actions. */ + +/* %% [12.0] debug code goes here */ + if ( yy_flex_debug ) + { + if ( yy_act == 0 ) + fprintf( stderr, "--scanner backing up\n" ); + else if ( yy_act < 63 ) + fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", + (long)yy_rule_linenum[yy_act], yytext ); + else if ( yy_act == 63 ) + fprintf( stderr, "--accepting default rule (\"%s\")\n", + yytext ); + else if ( yy_act == 64 ) + 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 133 "netconf_lexer.ll" +; + YY_BREAK +case 2: +YY_RULE_SETUP +#line 135 "netconf_lexer.ll" +; + YY_BREAK +case 3: +YY_RULE_SETUP +#line 137 "netconf_lexer.ll" +{ + BEGIN(COMMENT); + comment_start_line = driver.loc_.end.line;; +} + YY_BREAK +case 4: +YY_RULE_SETUP +#line 142 "netconf_lexer.ll" +BEGIN(INITIAL); + YY_BREAK +case 5: +YY_RULE_SETUP +#line 143 "netconf_lexer.ll" +; + YY_BREAK +case YY_STATE_EOF(COMMENT): +#line 144 "netconf_lexer.ll" +{ + isc_throw(ParseError, "Comment not closed. (/* in line " << comment_start_line); +} + YY_BREAK +case 6: +YY_RULE_SETUP +#line 148 "netconf_lexer.ll" +BEGIN(DIR_ENTER); + YY_BREAK +case 7: +YY_RULE_SETUP +#line 149 "netconf_lexer.ll" +BEGIN(DIR_INCLUDE); + YY_BREAK +case 8: +YY_RULE_SETUP +#line 150 "netconf_lexer.ll" +{ + /* Include directive. */ + + /* Extract the filename. */ + std::string tmp(yytext+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 159 "netconf_lexer.ll" +{ + isc_throw(ParseError, "Directive not closed."); +} + YY_BREAK +case 9: +YY_RULE_SETUP +#line 162 "netconf_lexer.ll" +BEGIN(INITIAL); + YY_BREAK +case 10: +YY_RULE_SETUP +#line 165 "netconf_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 170 "netconf_lexer.ll" +{ + /* Newline found. Let's update the location and continue. */ + driver.loc_.lines(yyleng); + driver.loc_.step(); +} + YY_BREAK +case 12: +YY_RULE_SETUP +#line 177 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::CONFIG: + return NetconfParser::make_NETCONF(driver.loc_); + default: + return NetconfParser::make_STRING("Netconf", driver.loc_); + } +} + YY_BREAK +case 13: +YY_RULE_SETUP +#line 186 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::NETCONF: + case ParserContext::SERVER: + case ParserContext::CONTROL_SOCKET: + case ParserContext::LOGGERS: + return NetconfParser::make_USER_CONTEXT(driver.loc_); + default: + return NetconfParser::make_STRING("user-context", driver.loc_); + } +} + YY_BREAK +case 14: +YY_RULE_SETUP +#line 198 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::NETCONF: + case ParserContext::SERVER: + case ParserContext::CONTROL_SOCKET: + case ParserContext::LOGGERS: + return NetconfParser::make_COMMENT(driver.loc_); + default: + return NetconfParser::make_STRING("comment", driver.loc_); + } +} + YY_BREAK +case 15: +YY_RULE_SETUP +#line 210 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::NETCONF: + return NetconfParser::make_MANAGED_SERVERS(driver.loc_); + default: + return NetconfParser::make_STRING("managed-servers", driver.loc_); + } +} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 219 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::MANAGED_SERVERS: + return NetconfParser::make_DHCP4_SERVER(driver.loc_); + default: + return NetconfParser::make_STRING("dhcp4", driver.loc_); + } +} + YY_BREAK +case 17: +YY_RULE_SETUP +#line 228 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::MANAGED_SERVERS: + return NetconfParser::make_DHCP6_SERVER(driver.loc_); + default: + return NetconfParser::make_STRING("dhcp6", driver.loc_); + } +} + YY_BREAK +case 18: +YY_RULE_SETUP +#line 237 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::MANAGED_SERVERS: + return NetconfParser::make_D2_SERVER(driver.loc_); + default: + return NetconfParser::make_STRING("d2", driver.loc_); + } +} + YY_BREAK +case 19: +YY_RULE_SETUP +#line 246 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::MANAGED_SERVERS: + return NetconfParser::make_CA_SERVER(driver.loc_); + default: + return NetconfParser::make_STRING("ca", driver.loc_); + } +} + YY_BREAK +case 20: +YY_RULE_SETUP +#line 255 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::SERVER: + return NetconfParser::make_MODEL(driver.loc_); + default: + return NetconfParser::make_STRING("model", driver.loc_); + } +} + YY_BREAK +case 21: +YY_RULE_SETUP +#line 264 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::SERVER: + return NetconfParser::make_CONTROL_SOCKET(driver.loc_); + default: + return NetconfParser::make_STRING("control-socket", driver.loc_); + } +} + YY_BREAK +case 22: +YY_RULE_SETUP +#line 273 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::SOCKET_TYPE: + return NetconfParser::make_UNIX(driver.loc_); + default: + return NetconfParser::make_STRING("unix", driver.loc_); + } +} + YY_BREAK +case 23: +YY_RULE_SETUP +#line 282 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::SOCKET_TYPE: + return NetconfParser::make_HTTP(driver.loc_); + default: + return NetconfParser::make_STRING("http", driver.loc_); + } +} + YY_BREAK +case 24: +YY_RULE_SETUP +#line 291 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::SOCKET_TYPE: + return NetconfParser::make_STDOUT(driver.loc_); + default: + return NetconfParser::make_STRING("stdout", driver.loc_); + } +} + YY_BREAK +case 25: +YY_RULE_SETUP +#line 300 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::CONTROL_SOCKET: + case ParserContext::LOGGERS: + return NetconfParser::make_NAME(driver.loc_); + default: + return NetconfParser::make_STRING("name", driver.loc_); + } +} + YY_BREAK +case 26: +YY_RULE_SETUP +#line 310 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::CONTROL_SOCKET: + return NetconfParser::make_TYPE(driver.loc_); + default: + return NetconfParser::make_STRING("type", driver.loc_); + } +} + YY_BREAK +case 27: +YY_RULE_SETUP +#line 319 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::CONTROL_SOCKET: + return NetconfParser::make_HOST(driver.loc_); + default: + return NetconfParser::make_STRING("host", driver.loc_); + } +} + YY_BREAK +case 28: +YY_RULE_SETUP +#line 328 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::CONTROL_SOCKET: + return NetconfParser::make_PORT(driver.loc_); + default: + return NetconfParser::make_STRING("port", driver.loc_); + } +} + YY_BREAK +case 29: +YY_RULE_SETUP +#line 337 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::NETCONF: + return NetconfParser::make_HOOKS_LIBRARIES(driver.loc_); + default: + return NetconfParser::make_STRING("hooks-libraries", driver.loc_); + } +} + YY_BREAK +case 30: +YY_RULE_SETUP +#line 346 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::HOOKS_LIBRARIES: + return NetconfParser::make_LIBRARY(driver.loc_); + default: + return NetconfParser::make_STRING("library", driver.loc_); + } +} + YY_BREAK +case 31: +YY_RULE_SETUP +#line 355 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::HOOKS_LIBRARIES: + return NetconfParser::make_PARAMETERS(driver.loc_); + default: + return NetconfParser::make_STRING("parameters", driver.loc_); + } +} + YY_BREAK +case 32: +YY_RULE_SETUP +#line 364 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::CONFIG: + return NetconfParser::make_LOGGING(driver.loc_); + default: + return NetconfParser::make_STRING("Logging", driver.loc_); + } +} + YY_BREAK +case 33: +YY_RULE_SETUP +#line 373 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::LOGGING: + return NetconfParser::make_LOGGERS(driver.loc_); + default: + return NetconfParser::make_STRING("loggers", driver.loc_); + } +} + YY_BREAK +case 34: +YY_RULE_SETUP +#line 382 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::LOGGERS: + return NetconfParser::make_OUTPUT_OPTIONS(driver.loc_); + default: + return NetconfParser::make_STRING("output_options", driver.loc_); + } +} + YY_BREAK +case 35: +YY_RULE_SETUP +#line 391 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::OUTPUT_OPTIONS: + return NetconfParser::make_OUTPUT(driver.loc_); + default: + return NetconfParser::make_STRING("output", driver.loc_); + } +} + YY_BREAK +case 36: +YY_RULE_SETUP +#line 400 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::OUTPUT_OPTIONS: + return NetconfParser::make_FLUSH(driver.loc_); + default: + return NetconfParser::make_STRING("flush", driver.loc_); + } +} + YY_BREAK +case 37: +YY_RULE_SETUP +#line 409 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::OUTPUT_OPTIONS: + return NetconfParser::make_MAXSIZE(driver.loc_); + default: + return NetconfParser::make_STRING("maxsize", driver.loc_); + } +} + YY_BREAK +case 38: +YY_RULE_SETUP +#line 418 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::OUTPUT_OPTIONS: + return NetconfParser::make_MAXVER(driver.loc_); + default: + return NetconfParser::make_STRING("maxver", driver.loc_); + } +} + YY_BREAK +case 39: +YY_RULE_SETUP +#line 427 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::LOGGERS: + return NetconfParser::make_DEBUGLEVEL(driver.loc_); + default: + return NetconfParser::make_STRING("debuglevel", driver.loc_); + } +} + YY_BREAK +case 40: +YY_RULE_SETUP +#line 436 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::LOGGERS: + return NetconfParser::make_SEVERITY(driver.loc_); + default: + return NetconfParser::make_STRING("severity", driver.loc_); + } +} + YY_BREAK +case 41: +YY_RULE_SETUP +#line 445 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::CONFIG: + return NetconfParser::make_DHCP4(driver.loc_); + default: + return NetconfParser::make_STRING("Dhcp4", driver.loc_); + } +} + YY_BREAK +case 42: +YY_RULE_SETUP +#line 454 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::CONFIG: + return NetconfParser::make_DHCP6(driver.loc_); + default: + return NetconfParser::make_STRING("Dhcp6", driver.loc_); + } +} + YY_BREAK +case 43: +YY_RULE_SETUP +#line 463 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::CONFIG: + return NetconfParser::make_DHCPDDNS(driver.loc_); + default: + return NetconfParser::make_STRING("DhcpDdns", driver.loc_); + } +} + YY_BREAK +case 44: +YY_RULE_SETUP +#line 472 "netconf_lexer.ll" +{ + switch(driver.ctx_) { + case ParserContext::CONFIG: + return NetconfParser::make_CONTROL_AGENT(driver.loc_); + default: + return NetconfParser::make_STRING("Control-agent", driver.loc_); + } +} + YY_BREAK +case 45: +YY_RULE_SETUP +#line 481 "netconf_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(yytext+1); + size_t len = raw.size() - 1; + raw.resize(len); + std::string decoded; + decoded.reserve(len); + for (size_t pos = 0; pos < len; ++pos) { + int b = 0; + char c = raw[pos]; + switch (c) { + case '"': + /* impossible condition */ + driver.error(driver.loc_, "Bad quote in \"" + raw + "\""); + break; + 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': + /* support only \u0000 to \u00ff */ + ++pos; + if (pos + 4 > len) { + /* impossible condition */ + driver.error(driver.loc_, + "Overflow unicode escape in \"" + raw + "\""); + } + if ((raw[pos] != '0') || (raw[pos + 1] != '0')) { + driver.error(driver.loc_, "Unsupported unicode escape in \"" + raw + "\""); + } + pos += 2; + c = raw[pos]; + if ((c >= '0') && (c <= '9')) { + b = (c - '0') << 4; + } else if ((c >= 'A') && (c <= 'F')) { + b = (c - 'A' + 10) << 4; + } else if ((c >= 'a') && (c <= 'f')) { + b = (c - 'a' + 10) << 4; + } else { + /* impossible condition */ + driver.error(driver.loc_, "Not hexadecimal in unicode escape in \"" + raw + "\""); + } + pos++; + c = raw[pos]; + if ((c >= '0') && (c <= '9')) { + b |= c - '0'; + } else if ((c >= 'A') && (c <= 'F')) { + b |= c - 'A' + 10; + } else if ((c >= 'a') && (c <= 'f')) { + b |= c - 'a' + 10; + } else { + /* impossible condition */ + driver.error(driver.loc_, "Not hexadecimal in unicode escape in \"" + raw + "\""); + } + decoded.push_back(static_cast(b & 0xff)); + break; + 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 NetconfParser::make_STRING(decoded, driver.loc_); +} + YY_BREAK +case 46: +/* rule 46 can match eol */ +YY_RULE_SETUP +#line 580 "netconf_lexer.ll" +{ + /* Bad string with a forbidden control character inside */ + driver.error(driver.loc_, "Invalid control in " + std::string(yytext)); +} + YY_BREAK +case 47: +/* rule 47 can match eol */ +YY_RULE_SETUP +#line 585 "netconf_lexer.ll" +{ + /* Bad string with a bad escape inside */ + driver.error(driver.loc_, "Bad escape in " + std::string(yytext)); +} + YY_BREAK +case 48: +YY_RULE_SETUP +#line 590 "netconf_lexer.ll" +{ + /* Bad string with an open escape at the end */ + driver.error(driver.loc_, "Overflow escape in " + std::string(yytext)); +} + YY_BREAK +case 49: +YY_RULE_SETUP +#line 595 "netconf_lexer.ll" +{ return NetconfParser::make_LSQUARE_BRACKET(driver.loc_); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 596 "netconf_lexer.ll" +{ return NetconfParser::make_RSQUARE_BRACKET(driver.loc_); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 597 "netconf_lexer.ll" +{ return NetconfParser::make_LCURLY_BRACKET(driver.loc_); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 598 "netconf_lexer.ll" +{ return NetconfParser::make_RCURLY_BRACKET(driver.loc_); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 599 "netconf_lexer.ll" +{ return NetconfParser::make_COMMA(driver.loc_); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 600 "netconf_lexer.ll" +{ return NetconfParser::make_COLON(driver.loc_); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 602 "netconf_lexer.ll" +{ + /* An integer was found. */ + std::string tmp(yytext); + 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 NetconfParser::make_INTEGER(integer, driver.loc_); +} + YY_BREAK +case 56: +YY_RULE_SETUP +#line 620 "netconf_lexer.ll" +{ + /* A floating point was found. */ + std::string tmp(yytext); + 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 NetconfParser::make_FLOAT(fp, driver.loc_); +} + YY_BREAK +case 57: +YY_RULE_SETUP +#line 633 "netconf_lexer.ll" +{ + string tmp(yytext); + return NetconfParser::make_BOOLEAN(tmp == "true", driver.loc_); +} + YY_BREAK +case 58: +YY_RULE_SETUP +#line 638 "netconf_lexer.ll" +{ + return NetconfParser::make_NULL_TYPE(driver.loc_); +} + YY_BREAK +case 59: +YY_RULE_SETUP +#line 642 "netconf_lexer.ll" +driver.error (driver.loc_, "JSON true reserved keyword is lower case only"); + YY_BREAK +case 60: +YY_RULE_SETUP +#line 644 "netconf_lexer.ll" +driver.error (driver.loc_, "JSON false reserved keyword is lower case only"); + YY_BREAK +case 61: +YY_RULE_SETUP +#line 646 "netconf_lexer.ll" +driver.error (driver.loc_, "JSON null reserved keyword is lower case only"); + YY_BREAK +case 62: +YY_RULE_SETUP +#line 648 "netconf_lexer.ll" +driver.error (driver.loc_, "Invalid character: " + std::string(yytext)); + YY_BREAK +case YY_STATE_EOF(INITIAL): +#line 650 "netconf_lexer.ll" +{ + if (driver.states_.empty()) { + return NetconfParser::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(); + } + netconf__delete_buffer(YY_CURRENT_BUFFER); + netconf__switch_to_buffer(driver.states_.back()); + driver.states_.pop_back(); + + BEGIN(DIR_EXIT); +} + YY_BREAK +case 63: +YY_RULE_SETUP +#line 673 "netconf_lexer.ll" +ECHO; + YY_BREAK +#line 2620 "netconf_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 yyin at a new source and called + * yylex(). 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 = yyin; +/* %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 ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, 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 yylex */ +/* %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); + int 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 = (int) ((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 + { + int 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 ) + { + int 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. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + 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; + yyrestart( yyin ); + } + + 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 (((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 *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + (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 >= 340 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + 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 >= 340 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 339); + + 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 */ + int offset = (int) ((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. */ + yyrestart( yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return 0; + + 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 yytext */ + (yy_hold_char) = *++(yy_c_buf_p); + +/* %% [19.0] update BOL and yylineno */ + + 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 yyrestart (FILE * input_file ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); +} + +/* %if-c++-only */ +/* %endif */ + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ +/* %if-c-only */ + void yy_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 + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_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; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() 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 yy_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 */ + yyin = 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 yy_create_buffer (FILE * file, int size ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = 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 *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; +} + +/* %if-c++-only */ +/* %endif */ + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ +/* %if-c-only */ + void yy_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 ) + yyfree( (void *) b->yy_ch_buf ); + + yyfree( (void *) b ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ +/* %if-c-only */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ + +{ + int oerrno = errno; + + yy_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 yy_init_buffer was _probably_ + * called from yyrestart() 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 yy_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 ) + yy_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 yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_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 yy_switch_to_buffer. */ + yy_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 yypop_buffer_state (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_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 yyensure_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**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_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**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_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 yy_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 NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (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 = NULL; + 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; + + yy_switch_to_buffer( b ); + + return b; +} +/* %endif */ + +/* %if-c-only */ +/** Setup the input buffer state to scan a string. The next call to yylex() 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 + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr ) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) ); +} +/* %endif */ + +/* %if-c-only */ +/** Setup the input buffer state to scan the given bytes. The next call to yylex() 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 yy_scan_bytes (const char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_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 = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_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 yynoreturn yy_fatal_error (const char* msg ) +{ + 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 yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = 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 yyget_lineno (void) +{ + + return yylineno; +} + +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} + +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} + +/** Get the length of the current token. + * + */ +int yyget_leng (void) +{ + return yyleng; +} + +/** Get the current token. + * + */ + +char *yyget_text (void) +{ + return yytext; +} + +/* %if-reentrant */ +/* %endif */ + +/** Set the current line number. + * @param _line_number line number + * + */ +void yyset_lineno (int _line_number ) +{ + + yylineno = _line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str ) +{ + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str ) +{ + yyout = _out_str ; +} + +int yyget_debug (void) +{ + return yy_flex_debug; +} + +void yyset_debug (int _bdebug ) +{ + yy_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 yylex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = NULL; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = NULL; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} +/* %endif */ + +/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() 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, const 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 (const char * s ) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size ) +{ + return malloc(size); +} + +void *yyrealloc (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 realloc(ptr, size); +} + +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() 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 673 "netconf_lexer.ll" + + +using namespace isc::dhcp; + +void +ParserContext::scanStringBegin(const std::string& str, ParserType parser_type) +{ + start_token_flag = true; + start_token_value = parser_type; + + file_ = ""; + sfile_ = 0; + loc_.initialize(&file_); + yy_flex_debug = trace_scanning_; + YY_BUFFER_STATE buffer; + buffer = netconf__scan_bytes(str.c_str(), str.size()); + if (!buffer) { + fatal("cannot scan string"); + /* fatal() throws an exception so this can't be reached */ + } +} + +void +ParserContext::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_); + yy_flex_debug = trace_scanning_; + YY_BUFFER_STATE buffer; + + /* See netconf_lexer.cc header for available definitions */ + buffer = netconf__create_buffer(f, 65536 /*buffer size*/); + if (!buffer) { + fatal("cannot scan file " + filename); + } + netconf__switch_to_buffer(buffer); +} + +void +ParserContext::scanEnd() { + if (sfile_) + fclose(sfile_); + sfile_ = 0; + static_cast(netconf_lex_destroy()); + /* Close files */ + while (!sfiles_.empty()) { + FILE* f = sfiles_.back(); + if (f) { + fclose(f); + } + sfiles_.pop_back(); + } + /* Delete states */ + while (!states_.empty()) { + netconf__delete_buffer(states_.back()); + states_.pop_back(); + } +} + +void +ParserContext::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 = netconf__create_buffer(f, 65536 /*buffer size*/); + if (!buffer) { + fatal( "Can't scan include file " + filename); + } + netconf__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?"); } +}; +} +#endif /* !__clang_analyzer__ */ + diff --git a/src/bin/netconf/netconf_parser.cc b/src/bin/netconf/netconf_parser.cc new file mode 100644 index 0000000000..341717e4c5 --- /dev/null +++ b/src/bin/netconf/netconf_parser.cc @@ -0,0 +1,2081 @@ +// A Bison parser, made by GNU Bison 3.0.5. + +// Skeleton implementation for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018 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 netconf_lex + +// First part of user declarations. + +#line 39 "netconf_parser.cc" // lalr1.cc:406 + +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif + +#include "netconf_parser.h" + +// User implementation prologue. + +#line 53 "netconf_parser.cc" // lalr1.cc:414 +// Unqualified %code blocks. +#line 33 "netconf_parser.yy" // lalr1.cc:415 + +#include + +#line 59 "netconf_parser.cc" // lalr1.cc:415 + + +#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 NETCONF_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_ << '\n'; \ + } \ + } 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 // !NETCONF_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 // !NETCONF_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 "netconf_parser.yy" // lalr1.cc:481 +namespace isc { namespace netconf { +#line 145 "netconf_parser.cc" // lalr1.cc:481 + + /* 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 + NetconfParser::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. + NetconfParser::NetconfParser (isc::netconf::ParserContext& ctx_yyarg) + : +#if NETCONF_DEBUG + yydebug_ (false), + yycdebug_ (&std::cerr), +#endif + ctx (ctx_yyarg) + {} + + NetconfParser::~NetconfParser () + {} + + + /*---------------. + | Symbol types. | + `---------------*/ + + + + // by_state. + NetconfParser::by_state::by_state () + : state (empty_state) + {} + + NetconfParser::by_state::by_state (const by_state& other) + : state (other.state) + {} + + void + NetconfParser::by_state::clear () + { + state = empty_state; + } + + void + NetconfParser::by_state::move (by_state& that) + { + state = that.state; + that.clear (); + } + + NetconfParser::by_state::by_state (state_type s) + : state (s) + {} + + NetconfParser::symbol_number_type + NetconfParser::by_state::type_get () const + { + if (state == empty_state) + return empty_symbol; + else + return yystos_[state]; + } + + NetconfParser::stack_symbol_type::stack_symbol_type () + {} + + NetconfParser::stack_symbol_type::stack_symbol_type (const stack_symbol_type& that) + : super_type (that.state, that.location) + { + switch (that.type_get ()) + { + case 58: // value + case 61: // map_value + case 116: // socket_type_value + value.copy< ElementPtr > (that.value); + break; + + case 49: // "boolean" + value.copy< bool > (that.value); + break; + + case 48: // "floating point" + value.copy< double > (that.value); + break; + + case 47: // "integer" + value.copy< int64_t > (that.value); + break; + + case 46: // "constant string" + value.copy< std::string > (that.value); + break; + + default: + break; + } + + } + + NetconfParser::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that) + : super_type (s, that.location) + { + switch (that.type_get ()) + { + case 58: // value + case 61: // map_value + case 116: // socket_type_value + value.move< ElementPtr > (that.value); + break; + + case 49: // "boolean" + value.move< bool > (that.value); + break; + + case 48: // "floating point" + value.move< double > (that.value); + break; + + case 47: // "integer" + value.move< int64_t > (that.value); + break; + + case 46: // "constant string" + value.move< std::string > (that.value); + break; + + default: + break; + } + + // that is emptied. + that.type = empty_symbol; + } + + NetconfParser::stack_symbol_type& + NetconfParser::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + switch (that.type_get ()) + { + case 58: // value + case 61: // map_value + case 116: // socket_type_value + value.copy< ElementPtr > (that.value); + break; + + case 49: // "boolean" + value.copy< bool > (that.value); + break; + + case 48: // "floating point" + value.copy< double > (that.value); + break; + + case 47: // "integer" + value.copy< int64_t > (that.value); + break; + + case 46: // "constant string" + value.copy< std::string > (that.value); + break; + + default: + break; + } + + location = that.location; + return *this; + } + + + template + void + NetconfParser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym); + } + +#if NETCONF_DEBUG + template + void + NetconfParser::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 46: // "constant string" + +#line 108 "netconf_parser.yy" // lalr1.cc:635 + { yyoutput << yysym.value.template as< std::string > (); } +#line 378 "netconf_parser.cc" // lalr1.cc:635 + break; + + case 47: // "integer" + +#line 108 "netconf_parser.yy" // lalr1.cc:635 + { yyoutput << yysym.value.template as< int64_t > (); } +#line 385 "netconf_parser.cc" // lalr1.cc:635 + break; + + case 48: // "floating point" + +#line 108 "netconf_parser.yy" // lalr1.cc:635 + { yyoutput << yysym.value.template as< double > (); } +#line 392 "netconf_parser.cc" // lalr1.cc:635 + break; + + case 49: // "boolean" + +#line 108 "netconf_parser.yy" // lalr1.cc:635 + { yyoutput << yysym.value.template as< bool > (); } +#line 399 "netconf_parser.cc" // lalr1.cc:635 + break; + + case 58: // value + +#line 108 "netconf_parser.yy" // lalr1.cc:635 + { yyoutput << yysym.value.template as< ElementPtr > (); } +#line 406 "netconf_parser.cc" // lalr1.cc:635 + break; + + case 61: // map_value + +#line 108 "netconf_parser.yy" // lalr1.cc:635 + { yyoutput << yysym.value.template as< ElementPtr > (); } +#line 413 "netconf_parser.cc" // lalr1.cc:635 + break; + + case 116: // socket_type_value + +#line 108 "netconf_parser.yy" // lalr1.cc:635 + { yyoutput << yysym.value.template as< ElementPtr > (); } +#line 420 "netconf_parser.cc" // lalr1.cc:635 + break; + + + default: + break; + } + yyo << ')'; + } +#endif + + void + NetconfParser::yypush_ (const char* m, state_type s, symbol_type& sym) + { + stack_symbol_type t (s, sym); + yypush_ (m, t); + } + + void + NetconfParser::yypush_ (const char* m, stack_symbol_type& s) + { + if (m) + YY_SYMBOL_PRINT (m, s); + yystack_.push (s); + } + + void + NetconfParser::yypop_ (unsigned n) + { + yystack_.pop (n); + } + +#if NETCONF_DEBUG + std::ostream& + NetconfParser::debug_stream () const + { + return *yycdebug_; + } + + void + NetconfParser::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + NetconfParser::debug_level_type + NetconfParser::debug_level () const + { + return yydebug_; + } + + void + NetconfParser::set_debug_level (debug_level_type l) + { + yydebug_ = l; + } +#endif // NETCONF_DEBUG + + NetconfParser::state_type + NetconfParser::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_]; + } + + bool + NetconfParser::yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + bool + NetconfParser::yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == yytable_ninf_; + } + + int + NetconfParser::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\n"; + + + /* 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 << '\n'; + + // 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 58: // value + case 61: // map_value + case 116: // socket_type_value + yylhs.value.build< ElementPtr > (); + break; + + case 49: // "boolean" + yylhs.value.build< bool > (); + break; + + case 48: // "floating point" + yylhs.value.build< double > (); + break; + + case 47: // "integer" + yylhs.value.build< int64_t > (); + break; + + case 46: // "constant string" + yylhs.value.build< std::string > (); + break; + + default: + break; + } + + + // Default location. + { + slice slice (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, slice, yylen); + yyerror_range[1].location = yylhs.location; + } + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); + try + { + switch (yyn) + { + case 2: +#line 119 "netconf_parser.yy" // lalr1.cc:856 + { ctx.ctx_ = ctx.NO_KEYWORDS; } +#line 660 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 4: +#line 120 "netconf_parser.yy" // lalr1.cc:856 + { ctx.ctx_ = ctx.CONFIG; } +#line 666 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 6: +#line 121 "netconf_parser.yy" // lalr1.cc:856 + { ctx.ctx_ = ctx.NETCONF; } +#line 672 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 8: +#line 129 "netconf_parser.yy" // lalr1.cc:856 + { + // Parse the Control-netconf map + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.push_back(m); +} +#line 682 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 9: +#line 133 "netconf_parser.yy" // lalr1.cc:856 + { + // parsing completed +} +#line 690 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 10: +#line 140 "netconf_parser.yy" // lalr1.cc:856 + { + // Push back the JSON value on the stack + ctx.stack_.push_back(yystack_[0].value.as< ElementPtr > ()); +} +#line 699 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 11: +#line 146 "netconf_parser.yy" // lalr1.cc:856 + { yylhs.value.as< ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); } +#line 705 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 12: +#line 147 "netconf_parser.yy" // lalr1.cc:856 + { yylhs.value.as< ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as< double > (), ctx.loc2pos(yystack_[0].location))); } +#line 711 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 13: +#line 148 "netconf_parser.yy" // lalr1.cc:856 + { yylhs.value.as< ElementPtr > () = ElementPtr(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); } +#line 717 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 14: +#line 149 "netconf_parser.yy" // lalr1.cc:856 + { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); } +#line 723 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 15: +#line 150 "netconf_parser.yy" // lalr1.cc:856 + { yylhs.value.as< ElementPtr > () = ElementPtr(new NullElement(ctx.loc2pos(yystack_[0].location))); } +#line 729 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 16: +#line 151 "netconf_parser.yy" // lalr1.cc:856 + { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); } +#line 735 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 17: +#line 152 "netconf_parser.yy" // lalr1.cc:856 + { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); } +#line 741 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 18: +#line 156 "netconf_parser.yy" // lalr1.cc:856 + { + // 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 752 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 19: +#line 161 "netconf_parser.yy" // lalr1.cc:856 + { + // 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 762 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 20: +#line 167 "netconf_parser.yy" // lalr1.cc:856 + { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); } +#line 768 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 23: +#line 181 "netconf_parser.yy" // lalr1.cc:856 + { + // map containing a single entry + ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ()); + } +#line 777 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 24: +#line 185 "netconf_parser.yy" // lalr1.cc:856 + { + // 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 787 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 25: +#line 192 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.push_back(l); +} +#line 796 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 26: +#line 195 "netconf_parser.yy" // lalr1.cc:856 + { +} +#line 803 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 29: +#line 202 "netconf_parser.yy" // lalr1.cc:856 + { + // List consisting of a single element. + ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ()); + } +#line 812 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 30: +#line 206 "netconf_parser.yy" // lalr1.cc:856 + { + // List ending with , and a value. + ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ()); + } +#line 821 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 31: +#line 219 "netconf_parser.yy" // lalr1.cc:856 + { + 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 832 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 32: +#line 228 "netconf_parser.yy" // lalr1.cc:856 + { + // 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 843 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 33: +#line 233 "netconf_parser.yy" // lalr1.cc:856 + { + // 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 853 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 43: +#line 255 "netconf_parser.yy" // lalr1.cc:856 + { + + // Let's create a MapElement that will represent it, add it to the + // top level map (that's already on the stack) and put the new map + // on the stack as well, so child elements will be able to add + // themselves to it. + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("Netconf", m); + ctx.stack_.push_back(m); + ctx.enter(ctx.NETCONF); +} +#line 869 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 44: +#line 265 "netconf_parser.yy" // lalr1.cc:856 + { + // Ok, we're done with parsing control-netconf. Let's take the map + // off the stack. + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 880 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 52: +#line 285 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 888 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 53: +#line 287 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr parent = ctx.stack_.back(); + ElementPtr user_context = yystack_[0].value.as< ElementPtr > (); + ConstElementPtr old = parent->get("user-context"); + + // Handle already existing user context + if (old) { + // Check if it was a comment or a duplicate + if ((old->size() != 1) || !old->contains("comment")) { + std::stringstream msg; + msg << "duplicate user-context entries (previous at " + << old->getPosition().str() << ")"; + error(yystack_[3].location, msg.str()); + } + // Merge the comment + user_context->set("comment", old->get("comment")); + } + + // Set the user context + parent->set("user-context", user_context); + ctx.leave(); +} +#line 915 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 54: +#line 310 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 923 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 55: +#line 312 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr parent = ctx.stack_.back(); + ElementPtr user_context(new MapElement(ctx.loc2pos(yystack_[3].location))); + ElementPtr comment(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + user_context->set("comment", comment); + + // Handle already existing user context + ConstElementPtr old = parent->get("user-context"); + if (old) { + // Check for duplicate comment + if (old->contains("comment")) { + std::stringstream msg; + msg << "duplicate user-context/comment entries (previous at " + << old->getPosition().str() << ")"; + error(yystack_[3].location, msg.str()); + } + // Merge the user context in the comment + merge(user_context, old); + } + + // Set the user context + parent->set("user-context", user_context); + ctx.leave(); +} +#line 952 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 56: +#line 338 "netconf_parser.yy" // lalr1.cc:856 + { + 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 963 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 57: +#line 343 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 972 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 62: +#line 356 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(m); + ctx.stack_.push_back(m); +} +#line 982 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 63: +#line 360 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); +} +#line 990 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 69: +#line 373 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 998 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 70: +#line 375 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr lib(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("library", lib); + ctx.leave(); +} +#line 1008 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 71: +#line 381 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 1016 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 72: +#line 383 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.back()->set("parameters", yystack_[0].value.as< ElementPtr > ()); + ctx.leave(); +} +#line 1025 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 73: +#line 391 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[2].location))); + ctx.stack_.back()->set("managed-servers", m); + ctx.stack_.push_back(m); + ctx.enter(ctx.MANAGED_SERVERS); +} +#line 1036 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 74: +#line 396 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1045 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 84: +#line 420 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("dhcp4", m); + ctx.stack_.push_back(m); + ctx.enter(ctx.SERVER); +} +#line 1056 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 85: +#line 425 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1065 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 86: +#line 431 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("dhcp6", m); + ctx.stack_.push_back(m); + ctx.enter(ctx.SERVER); +} +#line 1076 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 87: +#line 436 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1085 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 88: +#line 442 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("d2", m); + ctx.stack_.push_back(m); + ctx.enter(ctx.SERVER); +} +#line 1096 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 89: +#line 447 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1105 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 90: +#line 453 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("ca", m); + ctx.stack_.push_back(m); + ctx.enter(ctx.SERVER); +} +#line 1116 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 91: +#line 458 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1125 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 99: +#line 477 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 1133 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 100: +#line 479 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr model(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("model", model); + ctx.leave(); +} +#line 1143 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 101: +#line 486 "netconf_parser.yy" // lalr1.cc:856 + { + 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 1154 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 102: +#line 491 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1163 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 112: +#line 510 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.SOCKET_TYPE); +} +#line 1171 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 113: +#line 512 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.back()->set("type", yystack_[0].value.as< ElementPtr > ()); + ctx.leave(); +} +#line 1180 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 114: +#line 518 "netconf_parser.yy" // lalr1.cc:856 + { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("unix", ctx.loc2pos(yystack_[0].location))); } +#line 1186 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 115: +#line 519 "netconf_parser.yy" // lalr1.cc:856 + { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("http", ctx.loc2pos(yystack_[0].location))); } +#line 1192 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 116: +#line 520 "netconf_parser.yy" // lalr1.cc:856 + { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("stdout", ctx.loc2pos(yystack_[0].location))); } +#line 1198 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 117: +#line 523 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 1206 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 118: +#line 525 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("name", name); + ctx.leave(); +} +#line 1216 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 119: +#line 532 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 1224 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 120: +#line 534 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr host(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("host", host); + ctx.leave(); +} +#line 1234 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 121: +#line 541 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr port(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("port", port); +} +#line 1243 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 122: +#line 549 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 1251 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 123: +#line 551 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.back()->set("Dhcp4", yystack_[0].value.as< ElementPtr > ()); + ctx.leave(); +} +#line 1260 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 124: +#line 556 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 1268 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 125: +#line 558 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.back()->set("Dhcp6", yystack_[0].value.as< ElementPtr > ()); + ctx.leave(); +} +#line 1277 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 126: +#line 563 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 1285 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 127: +#line 565 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.back()->set("DhcpDdns", yystack_[0].value.as< ElementPtr > ()); + ctx.leave(); +} +#line 1294 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 128: +#line 570 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 1302 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 129: +#line 572 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.back()->set("Control-agent", yystack_[0].value.as< ElementPtr > ()); + ctx.leave(); +} +#line 1311 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 130: +#line 583 "netconf_parser.yy" // lalr1.cc:856 + { + 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 1322 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 131: +#line 588 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1331 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 135: +#line 605 "netconf_parser.yy" // lalr1.cc:856 + { + 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 1342 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 136: +#line 610 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1351 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 139: +#line 622 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(l); + ctx.stack_.push_back(l); +} +#line 1361 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 140: +#line 626 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); +} +#line 1369 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 150: +#line 643 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr dl(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("debuglevel", dl); +} +#line 1378 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 151: +#line 648 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 1386 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 152: +#line 650 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("severity", sev); + ctx.leave(); +} +#line 1396 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 153: +#line 656 "netconf_parser.yy" // lalr1.cc:856 + { + 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 1407 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 154: +#line 661 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); + ctx.leave(); +} +#line 1416 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 157: +#line 670 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->add(m); + ctx.stack_.push_back(m); +} +#line 1426 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 158: +#line 674 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.stack_.pop_back(); +} +#line 1434 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 165: +#line 688 "netconf_parser.yy" // lalr1.cc:856 + { + ctx.enter(ctx.NO_KEYWORDS); +} +#line 1442 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 166: +#line 690 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("output", sev); + ctx.leave(); +} +#line 1452 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 167: +#line 696 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr flush(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("flush", flush); +} +#line 1461 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 168: +#line 701 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr maxsize(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("maxsize", maxsize); +} +#line 1470 "netconf_parser.cc" // lalr1.cc:856 + break; + + case 169: +#line 706 "netconf_parser.yy" // lalr1.cc:856 + { + ElementPtr maxver(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); + ctx.stack_.back()->set("maxver", maxver); +} +#line 1479 "netconf_parser.cc" // lalr1.cc:856 + break; + + +#line 1483 "netconf_parser.cc" // lalr1.cc:856 + 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; + /* 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\n"; + // 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 + NetconfParser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what ()); + } + + // Generate an error message. + std::string + NetconfParser::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 + default: // Avoid compiler warnings. + 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 NetconfParser::yypact_ninf_ = -216; + + const signed char NetconfParser::yytable_ninf_ = -1; + + const short int + NetconfParser::yypact_[] = + { + 74, -216, -216, -216, 8, 2, 3, 39, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, 2, -13, -5, 11, -216, 52, + 72, 79, 77, 84, -216, -216, -216, -216, -216, -216, + 102, -216, 23, -216, -216, -216, -216, -216, -216, -216, + -216, -216, 107, -216, -216, 53, -216, -216, -216, -216, + -216, -216, 2, 2, -216, 59, 111, 122, 123, 124, + 125, 126, -216, -5, -216, 127, 128, 129, 130, 11, + -216, -216, -216, 131, 132, 133, 2, 2, 2, 2, + -216, 134, 87, -216, 137, -216, 2, 11, 106, -216, + -216, -216, -216, -216, -216, -216, -2, 136, -216, 56, + -216, 62, -216, -216, -216, -216, -216, -216, -216, 138, + 135, -216, -216, -216, -216, -216, -216, 139, 141, -216, + -216, 143, 106, -216, 144, 145, 146, 147, -216, -2, + -1, -216, 136, 148, -216, 149, 150, 151, 155, -216, + -216, -216, -216, 76, -216, -216, -216, -216, 157, 70, + 70, 70, 70, 161, 162, -11, -216, -216, 26, -216, + -216, -216, -216, -216, -216, 90, -216, -216, -216, 91, + 92, 93, 108, 2, -216, 28, 157, -216, 163, 164, + 70, -216, -216, -216, -216, -216, -216, -216, -216, 165, + -216, -216, -216, -216, -216, 94, -216, -216, -216, -216, + -216, 109, 166, -216, 167, 168, 105, 170, 28, -216, + -216, 66, 140, 171, -216, 142, -216, -216, -216, 173, + -216, -216, -216, 100, -216, -216, -216, -216, -216, -216, + 172, -216, 174, 176, 152, 66, -216, -216, 104, -216, + 99, 154, -216, -216, -17, 172, -216, -216, -216, -216, + -216, -216, -216, 177, 178, 179, 101, -216, -216, -216, + -216, -216, -216, 180, 121, 156, 158, -17, -216, 160, + -216, -216, -216, -216, -216 + }; + + const unsigned char + NetconfParser::yydefact_[] = + { + 0, 2, 4, 6, 0, 0, 0, 0, 1, 25, + 18, 15, 14, 11, 12, 13, 3, 10, 16, 17, + 32, 5, 8, 7, 27, 21, 0, 0, 29, 0, + 28, 0, 0, 22, 43, 130, 122, 124, 126, 128, + 0, 42, 0, 34, 36, 38, 39, 40, 41, 37, + 52, 54, 0, 56, 51, 0, 45, 49, 50, 48, + 47, 26, 0, 0, 19, 0, 0, 0, 0, 0, + 0, 0, 31, 0, 33, 0, 0, 0, 0, 0, + 9, 30, 23, 0, 0, 0, 0, 0, 0, 0, + 35, 0, 0, 73, 0, 46, 0, 0, 0, 123, + 125, 127, 129, 20, 53, 55, 75, 58, 24, 0, + 135, 0, 132, 134, 84, 86, 88, 90, 83, 0, + 76, 77, 79, 80, 81, 82, 62, 0, 59, 60, + 44, 0, 0, 131, 0, 0, 0, 0, 74, 0, + 0, 57, 0, 0, 133, 0, 0, 0, 0, 78, + 69, 71, 66, 0, 64, 67, 68, 61, 0, 0, + 0, 0, 0, 0, 0, 0, 63, 139, 0, 137, + 99, 101, 98, 96, 97, 0, 92, 94, 95, 0, + 0, 0, 0, 0, 65, 0, 0, 136, 0, 0, + 0, 85, 87, 89, 91, 70, 72, 117, 153, 0, + 151, 149, 147, 148, 143, 0, 141, 145, 146, 144, + 138, 0, 0, 93, 0, 0, 0, 0, 0, 140, + 100, 0, 0, 0, 150, 0, 142, 112, 119, 0, + 111, 109, 110, 0, 103, 105, 106, 107, 108, 118, + 0, 152, 0, 0, 0, 0, 102, 157, 0, 155, + 0, 0, 121, 104, 0, 0, 154, 114, 115, 116, + 113, 120, 165, 0, 0, 0, 0, 159, 161, 162, + 163, 164, 156, 0, 0, 0, 0, 0, 158, 0, + 167, 168, 169, 160, 166 + }; + + const short int + NetconfParser::yypgoto_[] = + { + -216, -216, -216, -216, -216, -216, -216, -216, -20, 96, + -216, -216, -216, -216, -216, -216, -216, -216, -26, -216, + -216, -216, 112, -216, -216, 78, 110, -25, -216, -24, + -216, -216, -216, -216, -216, 48, -216, -216, 33, -216, + -216, -216, -216, -216, -216, -216, -216, 63, -216, -216, + -216, -216, -216, -216, -216, -216, -37, 1, -216, -216, + -216, -216, -216, -44, -216, -216, -216, -215, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, 75, -216, -216, -216, 18, -216, -216, + -10, -216, -216, -216, -216, -216, -216, -46, -216, -216, + -67, -216, -216, -216, -216, -216 + }; + + const short int + NetconfParser::yydefgoto_[] = + { + -1, 4, 5, 6, 7, 23, 27, 16, 17, 18, + 25, 104, 32, 33, 19, 24, 29, 30, 172, 21, + 26, 42, 43, 44, 66, 55, 56, 173, 75, 174, + 76, 59, 78, 127, 128, 129, 140, 153, 154, 155, + 163, 156, 164, 60, 106, 119, 120, 121, 122, 134, + 123, 135, 124, 136, 125, 137, 175, 176, 177, 188, + 178, 189, 233, 234, 235, 242, 260, 204, 214, 237, + 243, 238, 45, 68, 46, 69, 47, 70, 48, 71, + 49, 67, 111, 112, 113, 131, 168, 169, 185, 205, + 206, 207, 208, 217, 209, 215, 248, 249, 254, 266, + 267, 268, 273, 269, 270, 271 + }; + + const unsigned short int + NetconfParser::yytable_[] = + { + 41, 54, 57, 58, 28, 34, 236, 9, 8, 10, + 20, 11, 114, 115, 116, 117, 262, 150, 151, 263, + 264, 265, 50, 51, 52, 35, 73, 150, 151, 186, + 236, 74, 187, 31, 36, 37, 38, 39, 53, 50, + 51, 40, 81, 82, 40, 40, 22, 41, 12, 13, + 14, 15, 197, 54, 57, 58, 79, 40, 61, 79, + 198, 80, 199, 200, 130, 132, 99, 100, 101, 102, + 133, 54, 57, 58, 40, 62, 108, 50, 51, 165, + 118, 50, 51, 63, 166, 64, 227, 65, 170, 171, + 197, 228, 229, 190, 190, 190, 190, 218, 191, 192, + 193, 194, 219, 245, 277, 83, 72, 255, 246, 278, + 256, 77, 40, 118, 152, 84, 40, 1, 2, 3, + 257, 258, 259, 179, 180, 181, 85, 86, 87, 88, + 89, 91, 92, 105, 94, 96, 93, 110, 139, 97, + 98, 10, 107, 126, 142, 141, 138, 143, 145, 146, + 147, 148, 224, 158, 195, 220, 159, 160, 161, 201, + 202, 203, 162, 196, 167, 182, 183, 211, 212, 216, + 280, 222, 223, 221, 225, 109, 240, 244, 250, 247, + 251, 274, 275, 276, 279, 90, 239, 103, 241, 95, + 157, 213, 201, 202, 203, 230, 231, 232, 184, 252, + 261, 253, 149, 281, 210, 282, 284, 144, 226, 272, + 283, 0, 0, 0, 0, 0, 0, 0, 0, 230, + 231, 232 + }; + + const short int + NetconfParser::yycheck_[] = + { + 26, 27, 27, 27, 24, 10, 221, 5, 0, 7, + 7, 9, 14, 15, 16, 17, 33, 28, 29, 36, + 37, 38, 11, 12, 13, 30, 3, 28, 29, 3, + 245, 8, 6, 46, 39, 40, 41, 42, 27, 11, + 12, 46, 62, 63, 46, 46, 7, 73, 46, 47, + 48, 49, 24, 79, 79, 79, 3, 46, 6, 3, + 32, 8, 34, 35, 8, 3, 86, 87, 88, 89, + 8, 97, 97, 97, 46, 3, 96, 11, 12, 3, + 106, 11, 12, 4, 8, 8, 20, 3, 18, 19, + 24, 25, 26, 3, 3, 3, 3, 3, 8, 8, + 8, 8, 8, 3, 3, 46, 4, 3, 8, 8, + 6, 4, 46, 139, 140, 4, 46, 43, 44, 45, + 21, 22, 23, 160, 161, 162, 4, 4, 4, 4, + 4, 4, 4, 46, 4, 4, 7, 31, 3, 7, + 7, 7, 5, 7, 3, 6, 8, 4, 4, 4, + 4, 4, 47, 5, 46, 46, 7, 7, 7, 185, + 185, 185, 7, 183, 7, 4, 4, 4, 4, 4, + 49, 4, 4, 7, 4, 97, 5, 4, 4, 7, + 4, 4, 4, 4, 4, 73, 46, 91, 46, 79, + 142, 190, 218, 218, 218, 221, 221, 221, 165, 47, + 46, 245, 139, 47, 186, 47, 46, 132, 218, 255, + 277, -1, -1, -1, -1, -1, -1, -1, -1, 245, + 245, 245 + }; + + const unsigned char + NetconfParser::yystos_[] = + { + 0, 43, 44, 45, 51, 52, 53, 54, 0, 5, + 7, 9, 46, 47, 48, 49, 57, 58, 59, 64, + 7, 69, 7, 55, 65, 60, 70, 56, 58, 66, + 67, 46, 62, 63, 10, 30, 39, 40, 41, 42, + 46, 68, 71, 72, 73, 122, 124, 126, 128, 130, + 11, 12, 13, 27, 68, 75, 76, 77, 79, 81, + 93, 6, 3, 4, 8, 3, 74, 131, 123, 125, + 127, 129, 4, 3, 8, 78, 80, 4, 82, 3, + 8, 58, 58, 46, 4, 4, 4, 4, 4, 4, + 72, 4, 4, 7, 4, 76, 4, 7, 7, 58, + 58, 58, 58, 59, 61, 46, 94, 5, 58, 75, + 31, 132, 133, 134, 14, 15, 16, 17, 68, 95, + 96, 97, 98, 100, 102, 104, 7, 83, 84, 85, + 8, 135, 3, 8, 99, 101, 103, 105, 8, 3, + 86, 6, 3, 4, 133, 4, 4, 4, 4, 97, + 28, 29, 68, 87, 88, 89, 91, 85, 5, 7, + 7, 7, 7, 90, 92, 3, 8, 7, 136, 137, + 18, 19, 68, 77, 79, 106, 107, 108, 110, 106, + 106, 106, 4, 4, 88, 138, 3, 6, 109, 111, + 3, 8, 8, 8, 8, 46, 58, 24, 32, 34, + 35, 68, 77, 79, 117, 139, 140, 141, 142, 144, + 137, 4, 4, 107, 118, 145, 4, 143, 3, 8, + 46, 7, 4, 4, 47, 4, 140, 20, 25, 26, + 68, 77, 79, 112, 113, 114, 117, 119, 121, 46, + 5, 46, 115, 120, 4, 3, 8, 7, 146, 147, + 4, 4, 47, 113, 148, 3, 6, 21, 22, 23, + 116, 46, 33, 36, 37, 38, 149, 150, 151, 153, + 154, 155, 147, 152, 4, 4, 4, 3, 8, 4, + 49, 47, 47, 150, 46 + }; + + const unsigned char + NetconfParser::yyr1_[] = + { + 0, 50, 52, 51, 53, 51, 54, 51, 56, 55, + 57, 58, 58, 58, 58, 58, 58, 58, 60, 59, + 61, 62, 62, 63, 63, 65, 64, 66, 66, 67, + 67, 68, 70, 69, 71, 71, 72, 72, 72, 72, + 72, 72, 72, 74, 73, 75, 75, 76, 76, 76, + 76, 76, 78, 77, 80, 79, 82, 81, 83, 83, + 84, 84, 86, 85, 87, 87, 87, 88, 88, 90, + 89, 92, 91, 94, 93, 95, 95, 96, 96, 97, + 97, 97, 97, 97, 99, 98, 101, 100, 103, 102, + 105, 104, 106, 106, 107, 107, 107, 107, 107, 109, + 108, 111, 110, 112, 112, 113, 113, 113, 113, 113, + 113, 113, 115, 114, 116, 116, 116, 118, 117, 120, + 119, 121, 123, 122, 125, 124, 127, 126, 129, 128, + 131, 130, 132, 132, 133, 135, 134, 136, 136, 138, + 137, 139, 139, 140, 140, 140, 140, 140, 140, 140, + 141, 143, 142, 145, 144, 146, 146, 148, 147, 149, + 149, 150, 150, 150, 150, 152, 151, 153, 154, 155 + }; + + const unsigned char + NetconfParser::yyr2_[] = + { + 0, 2, 0, 3, 0, 3, 0, 3, 0, 4, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, + 1, 0, 1, 3, 5, 0, 4, 0, 1, 1, + 3, 2, 0, 4, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 0, 6, 1, 3, 1, 1, 1, + 1, 1, 0, 4, 0, 4, 0, 6, 0, 1, + 1, 3, 0, 4, 1, 3, 1, 1, 1, 0, + 4, 0, 4, 0, 6, 0, 1, 1, 3, 1, + 1, 1, 1, 1, 0, 6, 0, 6, 0, 6, + 0, 6, 1, 3, 1, 1, 1, 1, 1, 0, + 4, 0, 6, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 0, 4, 1, 1, 1, 0, 4, 0, + 4, 3, 0, 4, 0, 4, 0, 4, 0, 4, + 0, 6, 1, 3, 1, 0, 6, 1, 3, 0, + 4, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 3, 0, 4, 0, 6, 1, 3, 0, 4, 1, + 3, 1, 1, 1, 1, 0, 4, 3, 3, 3 + }; + + + + // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + // First, the terminals, then, starting at \a yyntokens_, nonterminals. + const char* + const NetconfParser::yytname_[] = + { + "\"end of file\"", "error", "$undefined", "\",\"", "\":\"", "\"[\"", + "\"]\"", "\"{\"", "\"}\"", "\"null\"", "\"Netconf\"", "\"user-context\"", + "\"comment\"", "\"managed-servers\"", "\"dhcp4\"", "\"dhcp6\"", "\"d2\"", + "\"ca\"", "\"model\"", "\"control-socket\"", "\"type\"", "\"unix\"", + "\"http\"", "\"stdout\"", "\"name\"", "\"host\"", "\"port\"", + "\"hooks-libraries\"", "\"library\"", "\"parameters\"", "\"Logging\"", + "\"loggers\"", "\"output_options\"", "\"output\"", "\"debuglevel\"", + "\"severity\"", "\"flush\"", "\"maxsize\"", "\"maxver\"", "\"Dhcp4\"", + "\"Dhcp6\"", "\"DhcpDdns\"", "\"Control-agent\"", "START_JSON", + "START_NETCONF", "START_SUB_NETCONF", "\"constant string\"", + "\"integer\"", "\"floating point\"", "\"boolean\"", "$accept", "start", + "$@1", "$@2", "$@3", "sub_netconf", "$@4", "json", "value", "map", "$@5", + "map_value", "map_content", "not_empty_map", "list_generic", "$@6", + "list_content", "not_empty_list", "unknown_map_entry", + "netconf_syntax_map", "$@7", "global_objects", "global_object", + "netconf_object", "$@8", "global_params", "global_param", "user_context", + "$@9", "comment", "$@10", "hooks_libraries", "$@11", + "hooks_libraries_list", "not_empty_hooks_libraries_list", + "hooks_library", "$@12", "hooks_params", "hooks_param", "library", + "$@13", "parameters", "$@14", "managed_servers", "$@15", + "servers_entries", "not_empty_servers_entries", "server_entry", + "dhcp4_server", "$@16", "dhcp6_server", "$@17", "d2_server", "$@18", + "ca_server", "$@19", "managed_server_params", "managed_server_param", + "model", "$@20", "control_socket", "$@21", "control_socket_params", + "control_socket_param", "socket_type", "$@22", "socket_type_value", + "name", "$@23", "host", "$@24", "port", "dhcp4_json_object", "$@25", + "dhcp6_json_object", "$@26", "dhcpddns_json_object", "$@27", + "control_agent_object", "$@28", "logging_object", "$@29", + "logging_params", "logging_param", "loggers", "$@30", "loggers_entries", + "logger_entry", "$@31", "logger_params", "logger_param", "debuglevel", + "severity", "$@32", "output_options_list", "$@33", + "output_options_list_content", "output_entry", "$@34", + "output_params_list", "output_params", "output", "$@35", "flush", + "maxsize", "maxver", YY_NULLPTR + }; + +#if NETCONF_DEBUG + const unsigned short int + NetconfParser::yyrline_[] = + { + 0, 119, 119, 119, 120, 120, 121, 121, 129, 129, + 140, 146, 147, 148, 149, 150, 151, 152, 156, 156, + 167, 172, 173, 181, 185, 192, 192, 198, 199, 202, + 206, 219, 228, 228, 240, 241, 245, 246, 247, 248, + 249, 250, 251, 255, 255, 272, 273, 278, 279, 280, + 281, 282, 285, 285, 310, 310, 338, 338, 348, 349, + 352, 353, 356, 356, 364, 365, 366, 369, 370, 373, + 373, 381, 381, 391, 391, 401, 402, 405, 406, 412, + 413, 414, 415, 416, 420, 420, 431, 431, 442, 442, + 453, 453, 464, 465, 469, 470, 471, 472, 473, 477, + 477, 486, 486, 497, 498, 501, 502, 503, 504, 505, + 506, 507, 510, 510, 518, 519, 520, 523, 523, 532, + 532, 541, 549, 549, 556, 556, 563, 563, 570, 570, + 583, 583, 596, 597, 601, 605, 605, 617, 618, 622, + 622, 630, 631, 634, 635, 636, 637, 638, 639, 640, + 643, 648, 648, 656, 656, 666, 667, 670, 670, 678, + 679, 682, 683, 684, 685, 688, 688, 696, 701, 706 + }; + + // Print the state stack on the debug stream. + void + NetconfParser::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_ << '\n'; + } + + // Report on the debug stream that the rule \a yyrule is going to be reduced. + void + NetconfParser::yy_reduce_print_ (int yyrule) + { + unsigned yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + // Print the symbols being reduced, and their result. + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):\n"; + // The symbols being reduced. + for (int yyi = 0; yyi < yynrhs; yyi++) + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + yystack_[(yynrhs) - (yyi + 1)]); + } +#endif // NETCONF_DEBUG + + +#line 14 "netconf_parser.yy" // lalr1.cc:1163 +} } // isc::netconf +#line 2073 "netconf_parser.cc" // lalr1.cc:1163 +#line 711 "netconf_parser.yy" // lalr1.cc:1164 + + +void +isc::netconf::NetconfParser::error(const location_type& loc, + const std::string& what) +{ + ctx.error(loc, what); +} diff --git a/src/bin/netconf/netconf_parser.h b/src/bin/netconf/netconf_parser.h new file mode 100644 index 0000000000..cd677da3c0 --- /dev/null +++ b/src/bin/netconf/netconf_parser.h @@ -0,0 +1,1548 @@ +// A Bison parser, made by GNU Bison 3.0.5. + +// Skeleton interface for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018 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 netconf_parser.h + ** Define the isc::netconf::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +#ifndef YY_NETCONF_NETCONF_PARSER_H_INCLUDED +# define YY_NETCONF_NETCONF_PARSER_H_INCLUDED +// // "%code requires" blocks. +#line 17 "netconf_parser.yy" // lalr1.cc:379 + +#include +#include +#include +#include + +using namespace isc::netconf; +using namespace isc::data; +using namespace std; + +#line 55 "netconf_parser.h" // lalr1.cc:379 + +# 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 NETCONF_DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define NETCONF_DEBUG 1 +# else +# define NETCONF_DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define NETCONF_DEBUG 1 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined NETCONF_DEBUG */ + +#line 14 "netconf_parser.yy" // lalr1.cc:379 +namespace isc { namespace netconf { +#line 140 "netconf_parser.h" // lalr1.cc:379 + + + + /// 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 NetconfParser + { + public: +#ifndef NETCONF_STYPE + /// An auxiliary type to compute the largest semantic type. + union union_type + { + // value + // map_value + // socket_type_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 NETCONF_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_NETCONF = 265, + TOKEN_USER_CONTEXT = 266, + TOKEN_COMMENT = 267, + TOKEN_MANAGED_SERVERS = 268, + TOKEN_DHCP4_SERVER = 269, + TOKEN_DHCP6_SERVER = 270, + TOKEN_D2_SERVER = 271, + TOKEN_CA_SERVER = 272, + TOKEN_MODEL = 273, + TOKEN_CONTROL_SOCKET = 274, + TOKEN_TYPE = 275, + TOKEN_UNIX = 276, + TOKEN_HTTP = 277, + TOKEN_STDOUT = 278, + TOKEN_NAME = 279, + TOKEN_HOST = 280, + TOKEN_PORT = 281, + TOKEN_HOOKS_LIBRARIES = 282, + TOKEN_LIBRARY = 283, + TOKEN_PARAMETERS = 284, + TOKEN_LOGGING = 285, + TOKEN_LOGGERS = 286, + TOKEN_OUTPUT_OPTIONS = 287, + TOKEN_OUTPUT = 288, + TOKEN_DEBUGLEVEL = 289, + TOKEN_SEVERITY = 290, + TOKEN_FLUSH = 291, + TOKEN_MAXSIZE = 292, + TOKEN_MAXVER = 293, + TOKEN_DHCP4 = 294, + TOKEN_DHCP6 = 295, + TOKEN_DHCPDDNS = 296, + TOKEN_CONTROL_AGENT = 297, + TOKEN_START_JSON = 298, + TOKEN_START_NETCONF = 299, + TOKEN_START_SUB_NETCONF = 300, + TOKEN_STRING = 301, + TOKEN_INTEGER = 302, + TOKEN_FLOAT = 303, + TOKEN_BOOLEAN = 304 + }; + }; + + /// (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_NETCONF (const location_type& l); + + static inline + symbol_type + make_USER_CONTEXT (const location_type& l); + + static inline + symbol_type + make_COMMENT (const location_type& l); + + static inline + symbol_type + make_MANAGED_SERVERS (const location_type& l); + + static inline + symbol_type + make_DHCP4_SERVER (const location_type& l); + + static inline + symbol_type + make_DHCP6_SERVER (const location_type& l); + + static inline + symbol_type + make_D2_SERVER (const location_type& l); + + static inline + symbol_type + make_CA_SERVER (const location_type& l); + + static inline + symbol_type + make_MODEL (const location_type& l); + + static inline + symbol_type + make_CONTROL_SOCKET (const location_type& l); + + static inline + symbol_type + make_TYPE (const location_type& l); + + static inline + symbol_type + make_UNIX (const location_type& l); + + static inline + symbol_type + make_HTTP (const location_type& l); + + static inline + symbol_type + make_STDOUT (const location_type& l); + + static inline + symbol_type + make_NAME (const location_type& l); + + static inline + symbol_type + make_HOST (const location_type& l); + + static inline + symbol_type + make_PORT (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_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_FLUSH (const location_type& l); + + static inline + symbol_type + make_MAXSIZE (const location_type& l); + + static inline + symbol_type + make_MAXVER (const location_type& l); + + static inline + symbol_type + make_DHCP4 (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_CONTROL_AGENT (const location_type& l); + + static inline + symbol_type + make_START_JSON (const location_type& l); + + static inline + symbol_type + make_START_NETCONF (const location_type& l); + + static inline + symbol_type + make_START_SUB_NETCONF (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. + NetconfParser (isc::netconf::ParserContext& ctx_yyarg); + virtual ~NetconfParser (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + +#if NETCONF_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. + NetconfParser (const NetconfParser&); + NetconfParser& operator= (const NetconfParser&); + + /// 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 char 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 char yystos_[]; + + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + static const unsigned char 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 NETCONF_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 (); + /// Copy construct. + stack_symbol_type (const stack_symbol_type& that); + /// 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 n = 1); + + /// Constants. + enum + { + yyeof_ = 0, + yylast_ = 221, ///< Last index in yytable_. + yynnts_ = 106, ///< Number of nonterminal symbols. + yyfinal_ = 8, ///< Termination state number. + yyterror_ = 1, + yyerrcode_ = 256, + yyntokens_ = 50 ///< Number of tokens. + }; + + + // User arguments. + isc::netconf::ParserContext& ctx; + }; + + // Symbol number corresponding to token number t. + inline + NetconfParser::token_number_type + NetconfParser::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 + }; + const unsigned user_token_number_max_ = 304; + 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 + NetconfParser::syntax_error::syntax_error (const location_type& l, const std::string& m) + : std::runtime_error (m) + , location (l) + {} + + // basic_symbol. + template + NetconfParser::basic_symbol::basic_symbol () + : value () + {} + + template + NetconfParser::basic_symbol::basic_symbol (const basic_symbol& other) + : Base (other) + , value () + , location (other.location) + { + switch (other.type_get ()) + { + case 58: // value + case 61: // map_value + case 116: // socket_type_value + value.copy< ElementPtr > (other.value); + break; + + case 49: // "boolean" + value.copy< bool > (other.value); + break; + + case 48: // "floating point" + value.copy< double > (other.value); + break; + + case 47: // "integer" + value.copy< int64_t > (other.value); + break; + + case 46: // "constant string" + value.copy< std::string > (other.value); + break; + + default: + break; + } + + } + + template + NetconfParser::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 58: // value + case 61: // map_value + case 116: // socket_type_value + value.copy< ElementPtr > (v); + break; + + case 49: // "boolean" + value.copy< bool > (v); + break; + + case 48: // "floating point" + value.copy< double > (v); + break; + + case 47: // "integer" + value.copy< int64_t > (v); + break; + + case 46: // "constant string" + value.copy< std::string > (v); + break; + + default: + break; + } +} + + + // Implementation of basic_symbol constructor for each type. + + template + NetconfParser::basic_symbol::basic_symbol (typename Base::kind_type t, const location_type& l) + : Base (t) + , value () + , location (l) + {} + + template + NetconfParser::basic_symbol::basic_symbol (typename Base::kind_type t, const ElementPtr v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} + + template + NetconfParser::basic_symbol::basic_symbol (typename Base::kind_type t, const bool v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} + + template + NetconfParser::basic_symbol::basic_symbol (typename Base::kind_type t, const double v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} + + template + NetconfParser::basic_symbol::basic_symbol (typename Base::kind_type t, const int64_t v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} + + template + NetconfParser::basic_symbol::basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} + + + template + NetconfParser::basic_symbol::~basic_symbol () + { + clear (); + } + + template + void + NetconfParser::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 58: // value + case 61: // map_value + case 116: // socket_type_value + value.template destroy< ElementPtr > (); + break; + + case 49: // "boolean" + value.template destroy< bool > (); + break; + + case 48: // "floating point" + value.template destroy< double > (); + break; + + case 47: // "integer" + value.template destroy< int64_t > (); + break; + + case 46: // "constant string" + value.template destroy< std::string > (); + break; + + default: + break; + } + + Base::clear (); + } + + template + bool + NetconfParser::basic_symbol::empty () const + { + return Base::type_get () == empty_symbol; + } + + template + void + NetconfParser::basic_symbol::move (basic_symbol& s) + { + super_type::move (s); + switch (this->type_get ()) + { + case 58: // value + case 61: // map_value + case 116: // socket_type_value + value.move< ElementPtr > (s.value); + break; + + case 49: // "boolean" + value.move< bool > (s.value); + break; + + case 48: // "floating point" + value.move< double > (s.value); + break; + + case 47: // "integer" + value.move< int64_t > (s.value); + break; + + case 46: // "constant string" + value.move< std::string > (s.value); + break; + + default: + break; + } + + location = s.location; + } + + // by_type. + inline + NetconfParser::by_type::by_type () + : type (empty_symbol) + {} + + inline + NetconfParser::by_type::by_type (const by_type& other) + : type (other.type) + {} + + inline + NetconfParser::by_type::by_type (token_type t) + : type (yytranslate_ (t)) + {} + + inline + void + NetconfParser::by_type::clear () + { + type = empty_symbol; + } + + inline + void + NetconfParser::by_type::move (by_type& that) + { + type = that.type; + that.clear (); + } + + inline + int + NetconfParser::by_type::type_get () const + { + return type; + } + + inline + NetconfParser::token_type + NetconfParser::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 + }; + return static_cast (yytoken_number_[type]); + } + // Implementation of make_symbol for each symbol type. + NetconfParser::symbol_type + NetconfParser::make_END (const location_type& l) + { + return symbol_type (token::TOKEN_END, l); + } + + NetconfParser::symbol_type + NetconfParser::make_COMMA (const location_type& l) + { + return symbol_type (token::TOKEN_COMMA, l); + } + + NetconfParser::symbol_type + NetconfParser::make_COLON (const location_type& l) + { + return symbol_type (token::TOKEN_COLON, l); + } + + NetconfParser::symbol_type + NetconfParser::make_LSQUARE_BRACKET (const location_type& l) + { + return symbol_type (token::TOKEN_LSQUARE_BRACKET, l); + } + + NetconfParser::symbol_type + NetconfParser::make_RSQUARE_BRACKET (const location_type& l) + { + return symbol_type (token::TOKEN_RSQUARE_BRACKET, l); + } + + NetconfParser::symbol_type + NetconfParser::make_LCURLY_BRACKET (const location_type& l) + { + return symbol_type (token::TOKEN_LCURLY_BRACKET, l); + } + + NetconfParser::symbol_type + NetconfParser::make_RCURLY_BRACKET (const location_type& l) + { + return symbol_type (token::TOKEN_RCURLY_BRACKET, l); + } + + NetconfParser::symbol_type + NetconfParser::make_NULL_TYPE (const location_type& l) + { + return symbol_type (token::TOKEN_NULL_TYPE, l); + } + + NetconfParser::symbol_type + NetconfParser::make_NETCONF (const location_type& l) + { + return symbol_type (token::TOKEN_NETCONF, l); + } + + NetconfParser::symbol_type + NetconfParser::make_USER_CONTEXT (const location_type& l) + { + return symbol_type (token::TOKEN_USER_CONTEXT, l); + } + + NetconfParser::symbol_type + NetconfParser::make_COMMENT (const location_type& l) + { + return symbol_type (token::TOKEN_COMMENT, l); + } + + NetconfParser::symbol_type + NetconfParser::make_MANAGED_SERVERS (const location_type& l) + { + return symbol_type (token::TOKEN_MANAGED_SERVERS, l); + } + + NetconfParser::symbol_type + NetconfParser::make_DHCP4_SERVER (const location_type& l) + { + return symbol_type (token::TOKEN_DHCP4_SERVER, l); + } + + NetconfParser::symbol_type + NetconfParser::make_DHCP6_SERVER (const location_type& l) + { + return symbol_type (token::TOKEN_DHCP6_SERVER, l); + } + + NetconfParser::symbol_type + NetconfParser::make_D2_SERVER (const location_type& l) + { + return symbol_type (token::TOKEN_D2_SERVER, l); + } + + NetconfParser::symbol_type + NetconfParser::make_CA_SERVER (const location_type& l) + { + return symbol_type (token::TOKEN_CA_SERVER, l); + } + + NetconfParser::symbol_type + NetconfParser::make_MODEL (const location_type& l) + { + return symbol_type (token::TOKEN_MODEL, l); + } + + NetconfParser::symbol_type + NetconfParser::make_CONTROL_SOCKET (const location_type& l) + { + return symbol_type (token::TOKEN_CONTROL_SOCKET, l); + } + + NetconfParser::symbol_type + NetconfParser::make_TYPE (const location_type& l) + { + return symbol_type (token::TOKEN_TYPE, l); + } + + NetconfParser::symbol_type + NetconfParser::make_UNIX (const location_type& l) + { + return symbol_type (token::TOKEN_UNIX, l); + } + + NetconfParser::symbol_type + NetconfParser::make_HTTP (const location_type& l) + { + return symbol_type (token::TOKEN_HTTP, l); + } + + NetconfParser::symbol_type + NetconfParser::make_STDOUT (const location_type& l) + { + return symbol_type (token::TOKEN_STDOUT, l); + } + + NetconfParser::symbol_type + NetconfParser::make_NAME (const location_type& l) + { + return symbol_type (token::TOKEN_NAME, l); + } + + NetconfParser::symbol_type + NetconfParser::make_HOST (const location_type& l) + { + return symbol_type (token::TOKEN_HOST, l); + } + + NetconfParser::symbol_type + NetconfParser::make_PORT (const location_type& l) + { + return symbol_type (token::TOKEN_PORT, l); + } + + NetconfParser::symbol_type + NetconfParser::make_HOOKS_LIBRARIES (const location_type& l) + { + return symbol_type (token::TOKEN_HOOKS_LIBRARIES, l); + } + + NetconfParser::symbol_type + NetconfParser::make_LIBRARY (const location_type& l) + { + return symbol_type (token::TOKEN_LIBRARY, l); + } + + NetconfParser::symbol_type + NetconfParser::make_PARAMETERS (const location_type& l) + { + return symbol_type (token::TOKEN_PARAMETERS, l); + } + + NetconfParser::symbol_type + NetconfParser::make_LOGGING (const location_type& l) + { + return symbol_type (token::TOKEN_LOGGING, l); + } + + NetconfParser::symbol_type + NetconfParser::make_LOGGERS (const location_type& l) + { + return symbol_type (token::TOKEN_LOGGERS, l); + } + + NetconfParser::symbol_type + NetconfParser::make_OUTPUT_OPTIONS (const location_type& l) + { + return symbol_type (token::TOKEN_OUTPUT_OPTIONS, l); + } + + NetconfParser::symbol_type + NetconfParser::make_OUTPUT (const location_type& l) + { + return symbol_type (token::TOKEN_OUTPUT, l); + } + + NetconfParser::symbol_type + NetconfParser::make_DEBUGLEVEL (const location_type& l) + { + return symbol_type (token::TOKEN_DEBUGLEVEL, l); + } + + NetconfParser::symbol_type + NetconfParser::make_SEVERITY (const location_type& l) + { + return symbol_type (token::TOKEN_SEVERITY, l); + } + + NetconfParser::symbol_type + NetconfParser::make_FLUSH (const location_type& l) + { + return symbol_type (token::TOKEN_FLUSH, l); + } + + NetconfParser::symbol_type + NetconfParser::make_MAXSIZE (const location_type& l) + { + return symbol_type (token::TOKEN_MAXSIZE, l); + } + + NetconfParser::symbol_type + NetconfParser::make_MAXVER (const location_type& l) + { + return symbol_type (token::TOKEN_MAXVER, l); + } + + NetconfParser::symbol_type + NetconfParser::make_DHCP4 (const location_type& l) + { + return symbol_type (token::TOKEN_DHCP4, l); + } + + NetconfParser::symbol_type + NetconfParser::make_DHCP6 (const location_type& l) + { + return symbol_type (token::TOKEN_DHCP6, l); + } + + NetconfParser::symbol_type + NetconfParser::make_DHCPDDNS (const location_type& l) + { + return symbol_type (token::TOKEN_DHCPDDNS, l); + } + + NetconfParser::symbol_type + NetconfParser::make_CONTROL_AGENT (const location_type& l) + { + return symbol_type (token::TOKEN_CONTROL_AGENT, l); + } + + NetconfParser::symbol_type + NetconfParser::make_START_JSON (const location_type& l) + { + return symbol_type (token::TOKEN_START_JSON, l); + } + + NetconfParser::symbol_type + NetconfParser::make_START_NETCONF (const location_type& l) + { + return symbol_type (token::TOKEN_START_NETCONF, l); + } + + NetconfParser::symbol_type + NetconfParser::make_START_SUB_NETCONF (const location_type& l) + { + return symbol_type (token::TOKEN_START_SUB_NETCONF, l); + } + + NetconfParser::symbol_type + NetconfParser::make_STRING (const std::string& v, const location_type& l) + { + return symbol_type (token::TOKEN_STRING, v, l); + } + + NetconfParser::symbol_type + NetconfParser::make_INTEGER (const int64_t& v, const location_type& l) + { + return symbol_type (token::TOKEN_INTEGER, v, l); + } + + NetconfParser::symbol_type + NetconfParser::make_FLOAT (const double& v, const location_type& l) + { + return symbol_type (token::TOKEN_FLOAT, v, l); + } + + NetconfParser::symbol_type + NetconfParser::make_BOOLEAN (const bool& v, const location_type& l) + { + return symbol_type (token::TOKEN_BOOLEAN, v, l); + } + + +#line 14 "netconf_parser.yy" // lalr1.cc:379 +} } // isc::netconf +#line 1544 "netconf_parser.h" // lalr1.cc:379 + + + + +#endif // !YY_NETCONF_NETCONF_PARSER_H_INCLUDED diff --git a/src/bin/netconf/position.hh b/src/bin/netconf/position.hh new file mode 100644 index 0000000000..a4dd46cbfc --- /dev/null +++ b/src/bin/netconf/position.hh @@ -0,0 +1,180 @@ +// Generated 201809262116 +// A Bison parser, made by GNU Bison 3.0.5. + +// Positions for Bison parsers in C++ + +// Copyright (C) 2002-2015, 2018 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::netconf::position class. + */ + +#ifndef YY_NETCONF_POSITION_HH_INCLUDED +# define YY_NETCONF_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 "netconf_parser.yy" // location.cc:292 +namespace isc { namespace netconf { +#line 56 "position.hh" // location.cc:292 + /// Abstract a position. + class position + { + public: + /// Construct a position. + explicit position (std::string* f = YY_NULLPTR, + unsigned l = 1u, + unsigned c = 1u) + : filename (f) + , line (l) + , column (c) + {} + + + /// Initialization. + void initialize (std::string* fn = YY_NULLPTR, + unsigned l = 1u, + unsigned 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 line; + /// Current column number. + unsigned column; + + private: + /// Compute max(min, lhs+rhs) (provided min <= lhs). + static unsigned add_ (unsigned lhs, int rhs, unsigned 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 "netconf_parser.yy" // location.cc:292 +} } // isc::netconf +#line 179 "position.hh" // location.cc:292 +#endif // !YY_NETCONF_POSITION_HH_INCLUDED diff --git a/src/bin/netconf/stack.hh b/src/bin/netconf/stack.hh new file mode 100644 index 0000000000..702f063c23 --- /dev/null +++ b/src/bin/netconf/stack.hh @@ -0,0 +1,157 @@ +// Generated 201809262116 +// A Bison parser, made by GNU Bison 3.0.5. + +// Stack handling for Bison parsers in C++ + +// Copyright (C) 2002-2015, 2018 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::netconf::stack class. + */ + +#ifndef YY_NETCONF_STACK_HH_INCLUDED +# define YY_NETCONF_STACK_HH_INCLUDED + +# include + +#line 14 "netconf_parser.yy" // stack.hh:131 +namespace isc { namespace netconf { +#line 46 "stack.hh" // stack.hh:131 + /// A stack with random access from its top. + 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 n) + : seq_ (n) + {} + + /// Random access. + /// + /// Index 0 returns the topmost element. + T& + operator[] (unsigned i) + { + return seq_[seq_.size () - 1 - i]; + } + + /// Random access. + /// + /// Index 0 returns the topmost element. + const T& + operator[] (unsigned i) const + { + return seq_[seq_.size () - 1 - i]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + void + push (T& t) + { + seq_.push_back (T()); + operator[](0).move (t); + } + + void + pop (unsigned n = 1) + { + for (; n; --n) + seq_.pop_back (); + } + + void + clear () + { + seq_.clear (); + } + + typename S::size_type + size () const + { + return seq_.size (); + } + + const_iterator + begin () const + { + return seq_.rbegin (); + } + + 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 range) + : stack_ (stack) + , range_ (range) + {} + + const T& + operator [] (unsigned i) const + { + return stack_[range_ - i]; + } + + private: + const S& stack_; + unsigned range_; + }; + +#line 14 "netconf_parser.yy" // stack.hh:131 +} } // isc::netconf +#line 155 "stack.hh" // stack.hh:131 + +#endif // !YY_NETCONF_STACK_HH_INCLUDED