From: Tomek Date: Sat, 25 Mar 2017 05:39:31 +0000 (-0500) Subject: [5132] several parser files regenerated X-Git-Tag: trac5196_base~12^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb402f7569c9649083401e51cd4a240be9ad7e7d;p=thirdparty%2Fkea.git [5132] several parser files regenerated --- diff --git a/src/lib/eval/lexer.cc b/src/lib/eval/lexer.cc index e8d987f81b..b688976e40 100644 --- a/src/lib/eval/lexer.cc +++ b/src/lib/eval/lexer.cc @@ -1,12 +1,13 @@ -#line 1 "lexer.cc" +#line 2 "lexer.cc" -#line 3 "lexer.cc" +#line 4 "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 eval_create_buffer @@ -34,8 +35,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 3 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -44,88 +45,11 @@ /* %endif */ /* %if-c-only */ - #define yy_create_buffer eval_create_buffer - - #define yy_delete_buffer eval_delete_buffer - - #define yy_scan_buffer eval_scan_buffer - - #define yy_scan_string eval_scan_string - - #define yy_scan_bytes eval_scan_bytes - - #define yy_init_buffer eval_init_buffer - - #define yy_flush_buffer eval_flush_buffer - - #define yy_load_buffer_state eval_load_buffer_state - - #define yy_switch_to_buffer eval_switch_to_buffer - - #define yypush_buffer_state evalpush_buffer_state - - #define yypop_buffer_state evalpop_buffer_state - - #define yyensure_buffer_stack evalensure_buffer_stack - - #define yylex evallex - - #define yyrestart evalrestart - - #define yylex_init evallex_init - - #define yylex_init_extra evallex_init_extra - - #define yylex_destroy evallex_destroy - - #define yyget_debug evalget_debug - - #define yyset_debug evalset_debug - - #define yyget_extra evalget_extra - - #define yyset_extra evalset_extra - - #define yyget_in evalget_in - - #define yyset_in evalset_in - - #define yyget_out evalget_out - - #define yyset_out evalset_out - - #define yyget_leng evalget_leng - - #define yyget_text evalget_text - - #define yyget_lineno evalget_lineno - - #define yyset_lineno evalset_lineno - - #define yywrap evalwrap - + /* %endif */ - #define yyalloc evalalloc - - #define yyrealloc evalrealloc - - #define yyfree evalfree - /* %if-c-only */ - #define yytext evaltext - - #define yyleng evalleng - - #define yyin evalin - - #define yyout evalout - - #define yy_flex_debug eval_flex_debug - - #define yylineno evallineno - /* %endif */ /* First, we deal with platform-specific or compiler-specific issues. */ @@ -212,25 +136,41 @@ typedef unsigned int flex_uint32_t; /* %if-c++-only */ /* %endif */ -/* TODO: this is always defined, so inline it */ -#define yyconst const +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const #else -#define yynoreturn +#define yyconst #endif /* %not-for-header */ + /* Returned upon end-of-file. */ #define YY_NULL 0 /* %ok-for-header */ /* %not-for-header */ -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* %ok-for-header */ /* %if-reentrant */ @@ -245,29 +185,25 @@ typedef unsigned int flex_uint32_t; * 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 evalrestart(evalin ) + #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. @@ -285,7 +221,7 @@ typedef size_t yy_size_t; #endif /* %if-not-reentrant */ -extern int evalleng; +extern yy_size_t evalleng; /* %endif */ /* %if-c-only */ @@ -297,10 +233,10 @@ extern FILE *evalin, *evalout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE evallex. + * existing scanners that call yyless() from OUTSIDE evallex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-evallineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. @@ -312,13 +248,6 @@ extern FILE *evalin, *evalout; if ( evaltext[yyl] == '\n' )\ --evallineno;\ }while(0) - #define YY_LINENO_REWIND_TO(dst) \ - do {\ - const char *p;\ - for ( p = yy_cp-1; p >= (dst); --p)\ - if ( *p == '\n' )\ - --evallineno;\ - }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -333,6 +262,7 @@ extern FILE *evalin, *evalout; YY_DO_BEFORE_ACTION; /* set up evaltext again */ \ } \ while ( 0 ) + #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -352,12 +282,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - int yy_buf_size; + yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t 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 @@ -380,7 +310,7 @@ struct yy_buffer_state 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. */ @@ -407,12 +337,13 @@ 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. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* %endif */ /* %ok-for-header */ @@ -427,6 +358,7 @@ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ #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. */ @@ -436,13 +368,14 @@ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* %if-not-reentrant */ /* %not-for-header */ + /* yy_hold_char holds the character lost when evaltext is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int evalleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t evalleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; +static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -454,30 +387,32 @@ static int yy_did_buffer_switch_on_eof; /* %endif */ -void evalrestart ( FILE *input_file ); -void eval_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE eval_create_buffer ( FILE *file, int size ); -void eval_delete_buffer ( YY_BUFFER_STATE b ); -void eval_flush_buffer ( YY_BUFFER_STATE b ); -void evalpush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void evalpop_buffer_state ( void ); +void evalrestart (FILE *input_file ); +void eval_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE eval_create_buffer (FILE *file,int size ); +void eval_delete_buffer (YY_BUFFER_STATE b ); +void eval_flush_buffer (YY_BUFFER_STATE b ); +void evalpush_buffer_state (YY_BUFFER_STATE new_buffer ); +void evalpop_buffer_state (void ); + +static void evalensure_buffer_stack (void ); +static void eval_load_buffer_state (void ); +static void eval_init_buffer (YY_BUFFER_STATE b,FILE *file ); -static void evalensure_buffer_stack ( void ); -static void eval_load_buffer_state ( void ); -static void eval_init_buffer ( YY_BUFFER_STATE b, FILE *file ); #define YY_FLUSH_BUFFER eval_flush_buffer(YY_CURRENT_BUFFER ) -YY_BUFFER_STATE eval_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE eval_scan_string ( const char *yy_str ); -YY_BUFFER_STATE eval_scan_bytes ( const char *bytes, int len ); +YY_BUFFER_STATE eval_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE eval_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE eval_scan_bytes (yyconst char *bytes,yy_size_t len ); /* %endif */ -void *evalalloc ( yy_size_t ); -void *evalrealloc ( void *, yy_size_t ); -void evalfree ( void * ); +void *evalalloc (yy_size_t ); +void *evalrealloc (void *,yy_size_t ); +void evalfree (void * ); #define yy_new_buffer eval_create_buffer + #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ @@ -487,6 +422,7 @@ void evalfree ( void * ); } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } + #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ @@ -496,38 +432,36 @@ void evalfree ( void * ); } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } + #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* %% [1.0] evaltext/evalin/evalout/yy_state_type/evallineno etc. def's & init go here */ /* Begin user sect3 */ -#define evalwrap() (/*CONSTCOND*/1) +#define evalwrap() 1 #define YY_SKIP_YYWRAP #define FLEX_DEBUG -typedef flex_uint8_t YY_CHAR; -FILE *evalin = NULL, *evalout = NULL; +typedef unsigned char YY_CHAR; + +FILE *evalin = (FILE *) 0, *evalout = (FILE *) 0; typedef int yy_state_type; extern int evallineno; + int evallineno = 1; extern char *evaltext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif #define yytext_ptr evaltext -/* %% [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 ); +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 yy_fatal_error (yyconst char msg[] ); /* %endif */ @@ -537,11 +471,12 @@ static void yynoreturn yy_fatal_error ( const char* msg ); #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ /* %% [2.0] code to fiddle evaltext and evalleng for yymore() goes here \ */\ - evalleng = (int) (yy_cp - yy_bp); \ + evalleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ /* %% [3.0] code to copy yytext_ptr to evaltext[] 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 51 #define YY_END_OF_BUFFER 52 @@ -552,7 +487,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_acclist[280] = +static yyconst flex_int16_t yy_acclist[280] = { 0, 52, 50, 51, 1, 50, 51, 2, 51, 50, 51, 44, 50, 51, 45, 50, 51, 49, 50, 51, 48, @@ -586,7 +521,7 @@ static const flex_int16_t yy_acclist[280] = 37,16390,16390, 36,16390,16390,16390, 34,16390 } ; -static const flex_int16_t yy_accept[199] = +static yyconst flex_int16_t yy_accept[199] = { 0, 1, 1, 1, 2, 4, 7, 9, 11, 14, 17, 20, 23, 25, 28, 31, 34, 36, 38, 41, 44, @@ -612,7 +547,7 @@ static const flex_int16_t yy_accept[199] = } ; -static const YY_CHAR yy_ec[256] = +static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -644,7 +579,7 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[45] = +static yyconst flex_int32_t yy_meta[45] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 4, 4, 4, 4, 5, 1, 4, 1, 1, 1, @@ -653,7 +588,7 @@ static const YY_CHAR yy_meta[45] = 1, 1, 1, 1 } ; -static const flex_int16_t yy_base[203] = +static yyconst flex_int16_t yy_base[203] = { 0, 0, 0, 310, 311, 307, 305, 303, 311, 311, 311, 311, 34, 311, 39, 36, 291, 289, 81, 115, 311, @@ -680,7 +615,7 @@ static const flex_int16_t yy_base[203] = 71, 215 } ; -static const flex_int16_t yy_def[203] = +static yyconst flex_int16_t yy_def[203] = { 0, 197, 1, 197, 197, 197, 197, 198, 197, 197, 197, 197, 197, 197, 197, 14, 199, 197, 197, 18, 197, @@ -707,7 +642,7 @@ static const flex_int16_t yy_def[203] = 197, 197 } ; -static const flex_int16_t yy_nxt[356] = +static yyconst flex_int16_t yy_nxt[356] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 16, 17, 18, 19, 19, 20, @@ -750,7 +685,7 @@ static const flex_int16_t yy_nxt[356] = 197, 197, 197, 197, 197 } ; -static const flex_int16_t yy_chk[356] = +static yyconst flex_int16_t yy_chk[356] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -794,7 +729,7 @@ static const flex_int16_t yy_chk[356] = } ; /* Table of booleans, true if rule could match eol. */ -static const flex_int32_t yy_rule_can_match_eol[52] = +static yyconst flex_int32_t yy_rule_can_match_eol[52] = { 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -803,13 +738,13 @@ static const flex_int32_t yy_rule_can_match_eol[52] = extern int eval_flex_debug; int eval_flex_debug = 1; -static const flex_int16_t yy_rule_linenum[51] = +static yyconst flex_int16_t yy_rule_linenum[51] = { 0, - 83, 88, 94, 104, 110, 128, 135, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191 + 99, 104, 110, 120, 126, 144, 151, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207 } ; static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; @@ -855,19 +790,23 @@ char *evaltext; // 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 +# undef evalwrap +# define evalwrap() 1 // The location of the current token. The lexer will keep updating it. This // variable will be useful for logging errors. static isc::eval::location loc; +namespace { + bool start_token_flag = false; + isc::eval::EvalContext::ParserType start_token_value; +}; + // To avoid the call to exit... oops! #define YY_FATAL_ERROR(msg) isc::eval::EvalContext::fatal(msg) -#line 867 "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 + using evalwrap requires linking with -lfl, which provides the default evalwrap 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. */ @@ -884,13 +823,12 @@ static isc::eval::location loc; /* 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. */ -#line 69 "lexer.ll" +#line 74 "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 +// by moving it ahead by evalleng bytes. evalleng specifies the length of the // currently matched token. #define YY_USER_ACTION loc.columns(evalleng); -#line 892 "lexer.cc" -#line 893 "lexer.cc" +#line 832 "lexer.cc" #define INITIAL 0 @@ -914,7 +852,7 @@ static isc::eval::location loc; /* %if-reentrant */ /* %if-c-only */ -static int yy_init_globals ( void ); +static int yy_init_globals (void ); /* %endif */ /* %if-reentrant */ @@ -924,31 +862,31 @@ static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int evallex_destroy ( void ); +int evallex_destroy (void ); -int evalget_debug ( void ); +int evalget_debug (void ); -void evalset_debug ( int debug_flag ); +void evalset_debug (int debug_flag ); -YY_EXTRA_TYPE evalget_extra ( void ); +YY_EXTRA_TYPE evalget_extra (void ); -void evalset_extra ( YY_EXTRA_TYPE user_defined ); +void evalset_extra (YY_EXTRA_TYPE user_defined ); -FILE *evalget_in ( void ); +FILE *evalget_in (void ); -void evalset_in ( FILE * _in_str ); +void evalset_in (FILE * in_str ); -FILE *evalget_out ( void ); +FILE *evalget_out (void ); -void evalset_out ( FILE * _out_str ); +void evalset_out (FILE * out_str ); - int evalget_leng ( void ); +yy_size_t evalget_leng (void ); -char *evalget_text ( void ); +char *evalget_text (void ); -int evalget_lineno ( void ); +int evalget_lineno (void ); -void evalset_lineno ( int _line_number ); +void evalset_lineno (int line_number ); /* %if-bison-bridge */ /* %endif */ @@ -959,35 +897,34 @@ void evalset_lineno ( int _line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int evalwrap ( void ); +extern "C" int evalwrap (void ); #else -extern int evalwrap ( void ); +extern int evalwrap (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 ); +static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); +static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ + #ifdef __cplusplus -static int yyinput ( void ); +static int yyinput (void ); #else -static int input ( void ); +static int input (void ); #endif /* %ok-for-header */ @@ -1000,12 +937,7 @@ static int input ( void ); /* 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. */ @@ -1014,7 +946,7 @@ static int input ( void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( evaltext, (size_t) evalleng, 1, evalout )) {} } while (0) +#define ECHO do { if (fwrite( evaltext, evalleng, 1, evalout )) {} } while (0) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ @@ -1029,7 +961,7 @@ static int input ( void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( evalin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1042,7 +974,7 @@ static int input ( void ); else \ { \ errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, evalin)) == 0 && ferror(evalin)) \ + while ( (result = fread(buf, 1, max_size, evalin))==0 && ferror(evalin)) \ { \ if( errno != EINTR) \ { \ @@ -1083,9 +1015,11 @@ static int input ( void ); /* %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 */ @@ -1116,7 +1050,7 @@ extern int evallex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; +#define YY_BREAK break; #endif /* %% [6.0] YY_RULE_SETUP definition goes here */ @@ -1124,14 +1058,38 @@ extern int evallex (void); 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; + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; +/* %% [7.0] user's declarations go here */ +#line 80 "lexer.ll" + + + + // Code run each time evallex is called. + loc.step(); + + if (start_token_flag) { + start_token_flag = false; + switch (start_token_value) { + case EvalContext::PARSER_BOOL: + return isc::eval::EvalParser::make_TOPLEVEL_BOOL(loc); + default: + case EvalContext::PARSER_STRING: + return isc::eval::EvalParser::make_TOPLEVEL_STRING(loc); + } + } + + + +#line 1092 "lexer.cc" + if ( !(yy_init) ) { (yy_init) = 1; @@ -1172,20 +1130,7 @@ YY_DECL eval_load_buffer_state( ); } - { -/* %% [7.0] user's declarations go here */ -#line 75 "lexer.ll" - - - -#line 79 "lexer.ll" - // Code run each time evallex is called. - loc.step(); - - -#line 1186 "lexer.cc" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + while ( 1 ) /* loops until end-of-file is reached */ { /* %% [8.0] yymore()-related code goes here */ yy_cp = (yy_c_buf_p); @@ -1207,14 +1152,14 @@ YY_DECL yy_match: do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*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 >= 198 ) - yy_c = yy_meta[yy_c]; + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } @@ -1269,7 +1214,7 @@ find_rule: /* we branch to this label when backing up */ int yyl; for ( yyl = 0; yyl < evalleng; ++yyl ) if ( evaltext[yyl] == '\n' ) - + evallineno++; ; } @@ -1298,7 +1243,7 @@ do_action: /* This label is used only to access EOF actions. */ /* %% [13.0] actions go here */ case 1: YY_RULE_SETUP -#line 83 "lexer.ll" +#line 99 "lexer.ll" { // Ok, we found a with space. Let's ignore it and update loc variable. loc.step(); @@ -1307,7 +1252,7 @@ YY_RULE_SETUP case 2: /* rule 2 can match eol */ YY_RULE_SETUP -#line 88 "lexer.ll" +#line 104 "lexer.ll" { // Newline found. Let's update the location and continue. loc.lines(evalleng); @@ -1316,7 +1261,7 @@ YY_RULE_SETUP YY_BREAK case 3: YY_RULE_SETUP -#line 94 "lexer.ll" +#line 110 "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. @@ -1329,7 +1274,7 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 104 "lexer.ll" +#line 120 "lexer.ll" { // A hex string has been matched. It contains the '0x' or '0X' header // followed by at least one hexadecimal digit. @@ -1338,7 +1283,7 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 110 "lexer.ll" +#line 126 "lexer.ll" { // An integer was found. std::string tmp(evaltext); @@ -1360,7 +1305,7 @@ YY_RULE_SETUP case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 128 "lexer.ll" +#line 144 "lexer.ll" { // This string specifies option name starting with a letter // and further containing letters, digits, hyphens and @@ -1370,7 +1315,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 135 "lexer.ll" +#line 151 "lexer.ll" { // IPv4 or IPv6 address std::string tmp(evaltext); @@ -1387,229 +1332,229 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 149 "lexer.ll" +#line 165 "lexer.ll" return isc::eval::EvalParser::make_EQUAL(loc); YY_BREAK case 9: YY_RULE_SETUP -#line 150 "lexer.ll" +#line 166 "lexer.ll" return isc::eval::EvalParser::make_OPTION(loc); YY_BREAK case 10: YY_RULE_SETUP -#line 151 "lexer.ll" +#line 167 "lexer.ll" return isc::eval::EvalParser::make_RELAY4(loc); YY_BREAK case 11: YY_RULE_SETUP -#line 152 "lexer.ll" +#line 168 "lexer.ll" return isc::eval::EvalParser::make_RELAY6(loc); YY_BREAK case 12: YY_RULE_SETUP -#line 153 "lexer.ll" +#line 169 "lexer.ll" return isc::eval::EvalParser::make_PEERADDR(loc); YY_BREAK case 13: YY_RULE_SETUP -#line 154 "lexer.ll" +#line 170 "lexer.ll" return isc::eval::EvalParser::make_LINKADDR(loc); YY_BREAK case 14: YY_RULE_SETUP -#line 155 "lexer.ll" +#line 171 "lexer.ll" return isc::eval::EvalParser::make_TEXT(loc); YY_BREAK case 15: YY_RULE_SETUP -#line 156 "lexer.ll" +#line 172 "lexer.ll" return isc::eval::EvalParser::make_HEX(loc); YY_BREAK case 16: YY_RULE_SETUP -#line 157 "lexer.ll" +#line 173 "lexer.ll" return isc::eval::EvalParser::make_EXISTS(loc); YY_BREAK case 17: YY_RULE_SETUP -#line 158 "lexer.ll" +#line 174 "lexer.ll" return isc::eval::EvalParser::make_PKT(loc); YY_BREAK case 18: YY_RULE_SETUP -#line 159 "lexer.ll" +#line 175 "lexer.ll" return isc::eval::EvalParser::make_IFACE(loc); YY_BREAK case 19: YY_RULE_SETUP -#line 160 "lexer.ll" +#line 176 "lexer.ll" return isc::eval::EvalParser::make_SRC(loc); YY_BREAK case 20: YY_RULE_SETUP -#line 161 "lexer.ll" +#line 177 "lexer.ll" return isc::eval::EvalParser::make_DST(loc); YY_BREAK case 21: YY_RULE_SETUP -#line 162 "lexer.ll" +#line 178 "lexer.ll" return isc::eval::EvalParser::make_LEN(loc); YY_BREAK case 22: YY_RULE_SETUP -#line 163 "lexer.ll" +#line 179 "lexer.ll" return isc::eval::EvalParser::make_PKT4(loc); YY_BREAK case 23: YY_RULE_SETUP -#line 164 "lexer.ll" +#line 180 "lexer.ll" return isc::eval::EvalParser::make_CHADDR(loc); YY_BREAK case 24: YY_RULE_SETUP -#line 165 "lexer.ll" +#line 181 "lexer.ll" return isc::eval::EvalParser::make_HLEN(loc); YY_BREAK case 25: YY_RULE_SETUP -#line 166 "lexer.ll" +#line 182 "lexer.ll" return isc::eval::EvalParser::make_HTYPE(loc); YY_BREAK case 26: YY_RULE_SETUP -#line 167 "lexer.ll" +#line 183 "lexer.ll" return isc::eval::EvalParser::make_CIADDR(loc); YY_BREAK case 27: YY_RULE_SETUP -#line 168 "lexer.ll" +#line 184 "lexer.ll" return isc::eval::EvalParser::make_GIADDR(loc); YY_BREAK case 28: YY_RULE_SETUP -#line 169 "lexer.ll" +#line 185 "lexer.ll" return isc::eval::EvalParser::make_YIADDR(loc); YY_BREAK case 29: YY_RULE_SETUP -#line 170 "lexer.ll" +#line 186 "lexer.ll" return isc::eval::EvalParser::make_SIADDR(loc); YY_BREAK case 30: YY_RULE_SETUP -#line 171 "lexer.ll" +#line 187 "lexer.ll" return isc::eval::EvalParser::make_PKT6(loc); YY_BREAK case 31: YY_RULE_SETUP -#line 172 "lexer.ll" +#line 188 "lexer.ll" return isc::eval::EvalParser::make_MSGTYPE(loc); YY_BREAK case 32: YY_RULE_SETUP -#line 173 "lexer.ll" +#line 189 "lexer.ll" return isc::eval::EvalParser::make_TRANSID(loc); YY_BREAK case 33: YY_RULE_SETUP -#line 174 "lexer.ll" +#line 190 "lexer.ll" return isc::eval::EvalParser::make_VENDOR(loc); YY_BREAK case 34: YY_RULE_SETUP -#line 175 "lexer.ll" +#line 191 "lexer.ll" return isc::eval::EvalParser::make_VENDOR_CLASS(loc); YY_BREAK case 35: YY_RULE_SETUP -#line 176 "lexer.ll" +#line 192 "lexer.ll" return isc::eval::EvalParser::make_DATA(loc); YY_BREAK case 36: YY_RULE_SETUP -#line 177 "lexer.ll" +#line 193 "lexer.ll" return isc::eval::EvalParser::make_ENTERPRISE(loc); YY_BREAK case 37: YY_RULE_SETUP -#line 178 "lexer.ll" +#line 194 "lexer.ll" return isc::eval::EvalParser::make_SUBSTRING(loc); YY_BREAK case 38: YY_RULE_SETUP -#line 179 "lexer.ll" +#line 195 "lexer.ll" return isc::eval::EvalParser::make_ALL(loc); YY_BREAK case 39: YY_RULE_SETUP -#line 180 "lexer.ll" +#line 196 "lexer.ll" return isc::eval::EvalParser::make_CONCAT(loc); YY_BREAK case 40: YY_RULE_SETUP -#line 181 "lexer.ll" +#line 197 "lexer.ll" return isc::eval::EvalParser::make_NOT(loc); YY_BREAK case 41: YY_RULE_SETUP -#line 182 "lexer.ll" +#line 198 "lexer.ll" return isc::eval::EvalParser::make_AND(loc); YY_BREAK case 42: YY_RULE_SETUP -#line 183 "lexer.ll" +#line 199 "lexer.ll" return isc::eval::EvalParser::make_OR(loc); YY_BREAK case 43: YY_RULE_SETUP -#line 184 "lexer.ll" +#line 200 "lexer.ll" return isc::eval::EvalParser::make_DOT(loc); YY_BREAK case 44: YY_RULE_SETUP -#line 185 "lexer.ll" +#line 201 "lexer.ll" return isc::eval::EvalParser::make_LPAREN(loc); YY_BREAK case 45: YY_RULE_SETUP -#line 186 "lexer.ll" +#line 202 "lexer.ll" return isc::eval::EvalParser::make_RPAREN(loc); YY_BREAK case 46: YY_RULE_SETUP -#line 187 "lexer.ll" +#line 203 "lexer.ll" return isc::eval::EvalParser::make_LBRACKET(loc); YY_BREAK case 47: YY_RULE_SETUP -#line 188 "lexer.ll" +#line 204 "lexer.ll" return isc::eval::EvalParser::make_RBRACKET(loc); YY_BREAK case 48: YY_RULE_SETUP -#line 189 "lexer.ll" +#line 205 "lexer.ll" return isc::eval::EvalParser::make_COMA(loc); YY_BREAK case 49: YY_RULE_SETUP -#line 190 "lexer.ll" +#line 206 "lexer.ll" return isc::eval::EvalParser::make_ANY(loc); YY_BREAK case 50: YY_RULE_SETUP -#line 191 "lexer.ll" +#line 207 "lexer.ll" driver.error (loc, "Invalid character: " + std::string(evaltext)); YY_BREAK case YY_STATE_EOF(INITIAL): -#line 192 "lexer.ll" +#line 208 "lexer.ll" return isc::eval::EvalParser::make_END(loc); YY_BREAK case 51: YY_RULE_SETUP -#line 193 "lexer.ll" +#line 209 "lexer.ll" ECHO; YY_BREAK -#line 1612 "lexer.cc" +#line 1558 "lexer.cc" case YY_END_OF_BUFFER: { @@ -1632,11 +1577,7 @@ ECHO; * 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 = evalin; -/* %endif */ -/* %if-c++-only */ -/* %endif */ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } @@ -1743,12 +1684,12 @@ ECHO; "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of user's declarations */ } /* end of evallex */ /* %ok-for-header */ /* %if-c++-only */ /* %not-for-header */ + /* %ok-for-header */ /* %endif */ @@ -1766,9 +1707,9 @@ static int yy_get_next_buffer (void) /* %if-c++-only */ /* %endif */ { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1797,7 +1738,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1810,7 +1751,7 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1850,10 +1791,10 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((yy_size_t) ((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 *) evalrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,(yy_size_t) new_size ); + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) evalrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } @@ -1871,13 +1812,14 @@ static int yy_get_next_buffer (void) /* %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; + register yy_state_type yy_current_state; + register char *yy_cp; /* %% [15.0] code to get the start state into yy_current_state goes here */ yy_current_state = (yy_start); @@ -1888,14 +1830,14 @@ static int yy_get_next_buffer (void) 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); + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 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 >= 198 ) - yy_c = yy_meta[yy_c]; + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; } @@ -1913,17 +1855,17 @@ static int yy_get_next_buffer (void) /* %if-c++-only */ /* %endif */ { - int yy_is_jam; + register int yy_is_jam; /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ - YY_CHAR yy_c = 1; + register YY_CHAR yy_c = 1; 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 >= 198 ) - yy_c = yy_meta[yy_c]; + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 197); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; @@ -1931,11 +1873,9 @@ static int yy_get_next_buffer (void) return yy_is_jam ? 0 : yy_current_state; } -#ifndef YY_NO_UNPUT /* %if-c-only */ /* %endif */ -#endif /* %if-c-only */ #ifndef YY_NO_INPUT @@ -1965,7 +1905,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1989,7 +1929,7 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( evalwrap( ) ) - return 0; + return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -2013,7 +1953,7 @@ static int yy_get_next_buffer (void) /* %% [19.0] update BOL and evallineno */ if ( c == '\n' ) - + evallineno++; ; @@ -2045,9 +1985,6 @@ static int yy_get_next_buffer (void) eval_load_buffer_state( ); } -/* %if-c++-only */ -/* %endif */ - /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @@ -2095,11 +2032,7 @@ static void eval_load_buffer_state (void) { (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 */ evalin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; -/* %endif */ -/* %if-c++-only */ -/* %endif */ (yy_hold_char) = *(yy_c_buf_p); } @@ -2126,7 +2059,7 @@ static void eval_load_buffer_state (void) /* 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 *) evalalloc((yy_size_t) (b->yy_buf_size + 2) ); + b->yy_ch_buf = (char *) evalalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in eval_create_buffer()" ); @@ -2137,9 +2070,6 @@ static void eval_load_buffer_state (void) return b; } -/* %if-c++-only */ -/* %endif */ - /** Destroy the buffer. * @param b a buffer created with eval_create_buffer() * @@ -2178,11 +2108,7 @@ static void eval_load_buffer_state (void) eval_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 eval_init_buffer was _probably_ @@ -2317,15 +2243,15 @@ static void evalensure_buffer_stack (void) * 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... */ + num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)evalalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in evalensure_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; @@ -2334,7 +2260,7 @@ static void evalensure_buffer_stack (void) 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 */; + int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)evalrealloc @@ -2356,7 +2282,7 @@ static void evalensure_buffer_stack (void) * @param base the character buffer * @param size the size in bytes of the character buffer * - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE eval_scan_buffer (char * base, yy_size_t size ) { @@ -2366,16 +2292,16 @@ YY_BUFFER_STATE eval_scan_buffer (char * base, yy_size_t size ) 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; + return 0; b = (YY_BUFFER_STATE) evalalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in eval_scan_buffer()" ); - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; + b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; @@ -2397,10 +2323,10 @@ YY_BUFFER_STATE eval_scan_buffer (char * base, yy_size_t size ) * @note If you want to scan bytes that may contain NUL values, then use * eval_scan_bytes() instead. */ -YY_BUFFER_STATE eval_scan_string (const char * yystr ) +YY_BUFFER_STATE eval_scan_string (yyconst char * yystr ) { - return eval_scan_bytes(yystr,(int) strlen(yystr) ); + return eval_scan_bytes(yystr,strlen(yystr) ); } /* %endif */ @@ -2412,7 +2338,7 @@ YY_BUFFER_STATE eval_scan_string (const char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE eval_scan_bytes (const char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE eval_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; @@ -2420,7 +2346,7 @@ YY_BUFFER_STATE eval_scan_bytes (const char * yybytes, int _yybytes_len ) int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); + n = _yybytes_len + 2; buf = (char *) evalalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in eval_scan_bytes()" ); @@ -2448,9 +2374,9 @@ YY_BUFFER_STATE eval_scan_bytes (const char * yybytes, int _yybytes_len ) #endif /* %if-c-only */ -static void yynoreturn yy_fatal_error (const char* msg ) +static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* %endif */ @@ -2485,7 +2411,7 @@ static void yynoreturn yy_fatal_error (const char* msg ) */ int evalget_lineno (void) { - + return evallineno; } @@ -2508,7 +2434,7 @@ FILE *evalget_out (void) /** Get the length of the current token. * */ -int evalget_leng (void) +yy_size_t evalget_leng (void) { return evalleng; } @@ -2526,29 +2452,29 @@ char *evalget_text (void) /* %endif */ /** Set the current line number. - * @param _line_number line number + * @param line_number * */ -void evalset_lineno (int _line_number ) +void evalset_lineno (int line_number ) { - evallineno = _line_number; + evallineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param _in_str A readable stream. + * @param in_str A readable stream. * * @see eval_switch_to_buffer */ -void evalset_in (FILE * _in_str ) +void evalset_in (FILE * in_str ) { - evalin = _in_str ; + evalin = in_str ; } -void evalset_out (FILE * _out_str ) +void evalset_out (FILE * out_str ) { - evalout = _out_str ; + evalout = out_str ; } int evalget_debug (void) @@ -2556,9 +2482,9 @@ int evalget_debug (void) return eval_flex_debug; } -void evalset_debug (int _bdebug ) +void evalset_debug (int bdebug ) { - eval_flex_debug = _bdebug ; + eval_flex_debug = bdebug ; } /* %endif */ @@ -2578,10 +2504,10 @@ static int yy_init_globals (void) /* We do not touch evallineno unless the option is enabled. */ evallineno = 1; - (yy_buffer_stack) = NULL; + (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; + (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; @@ -2595,8 +2521,8 @@ static int yy_init_globals (void) evalin = stdin; evalout = stdout; #else - evalin = NULL; - evalout = NULL; + evalin = (FILE *) 0; + evalout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by @@ -2640,19 +2566,18 @@ int evallex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - - int i; + register 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 ) +static int yy_flex_strlen (yyconst char * s ) { - int n; + register int n; for ( n = 0; s[n]; ++n ) ; @@ -2662,12 +2587,11 @@ static int yy_flex_strlen (const char * s ) void *evalalloc (yy_size_t size ) { - return malloc(size); + return (void *) malloc( size ); } void *evalrealloc (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 @@ -2675,12 +2599,12 @@ void *evalrealloc (void * ptr, yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return realloc(ptr, size); + return (void *) realloc( (char *) ptr, size ); } void evalfree (void * ptr ) { - free( (char *) ptr ); /* see evalrealloc() for (char *) cast */ + free( (char *) ptr ); /* see evalrealloc() for (char *) cast */ } /* %if-tables-serialization definitions */ @@ -2690,14 +2614,18 @@ void evalfree (void * ptr ) /* %ok-for-header */ -#line 193 "lexer.ll" +#line 209 "lexer.ll" + using namespace isc::eval; void -EvalContext::scanStringBegin() +EvalContext::scanStringBegin(ParserType type) { + start_token_flag = true; + start_token_value = type; + loc.initialize(&file_); eval_flex_debug = trace_scanning_; YY_BUFFER_STATE buffer; diff --git a/src/lib/eval/location.hh b/src/lib/eval/location.hh index 35e5da8dd7..e6997a26b9 100644 --- a/src/lib/eval/location.hh +++ b/src/lib/eval/location.hh @@ -1,4 +1,3 @@ -// Generated 201702011420 // A Bison parser, made by GNU Bison 3.0.4. // Locations for Bison parsers in C++ @@ -41,9 +40,9 @@ # include "position.hh" -#line 14 "parser.yy" // location.cc:296 +#line 14 "parser.yy" // location.cc:337 namespace isc { namespace eval { -#line 46 "location.hh" // location.cc:296 +#line 46 "location.hh" // location.cc:337 /// Abstract a location. class location { @@ -187,7 +186,7 @@ namespace isc { namespace eval { return ostr; } -#line 14 "parser.yy" // location.cc:296 +#line 14 "parser.yy" // location.cc:337 } } // isc::eval -#line 192 "location.hh" // location.cc:296 +#line 192 "location.hh" // location.cc:337 #endif // !YY_EVAL_LOCATION_HH_INCLUDED diff --git a/src/lib/eval/parser.cc b/src/lib/eval/parser.cc index 2891cb0b4e..489bb57182 100644 --- a/src/lib/eval/parser.cc +++ b/src/lib/eval/parser.cc @@ -253,44 +253,44 @@ namespace isc { namespace eval { { switch (that.type_get ()) { - case 56: // option_repr_type + case 60: // option_repr_type value.move< TokenOption::RepresentationType > (that.value); break; - case 60: // pkt4_field + case 64: // pkt4_field value.move< TokenPkt4::FieldType > (that.value); break; - case 61: // pkt6_field + case 65: // pkt6_field value.move< TokenPkt6::FieldType > (that.value); break; - case 58: // pkt_metadata + case 62: // pkt_metadata value.move< TokenPkt::MetadataType > (that.value); break; - case 62: // relay6_field + case 66: // relay6_field value.move< TokenRelay6Field::FieldType > (that.value); break; - case 45: // "constant string" - case 46: // "integer" - case 47: // "constant hexstring" - case 48: // "option name" - case 49: // "ip address" + case 47: // "constant string" + case 48: // "integer" + case 49: // "constant hexstring" + case 50: // "option name" + case 51: // "ip address" value.move< std::string > (that.value); break; - case 55: // option_code + case 59: // option_code value.move< uint16_t > (that.value); break; - case 54: // integer_expr - case 59: // enterprise_id + case 58: // integer_expr + case 63: // enterprise_id value.move< uint32_t > (that.value); break; - case 57: // nest_level + case 61: // nest_level value.move< uint8_t > (that.value); break; @@ -309,44 +309,44 @@ namespace isc { namespace eval { state = that.state; switch (that.type_get ()) { - case 56: // option_repr_type + case 60: // option_repr_type value.copy< TokenOption::RepresentationType > (that.value); break; - case 60: // pkt4_field + case 64: // pkt4_field value.copy< TokenPkt4::FieldType > (that.value); break; - case 61: // pkt6_field + case 65: // pkt6_field value.copy< TokenPkt6::FieldType > (that.value); break; - case 58: // pkt_metadata + case 62: // pkt_metadata value.copy< TokenPkt::MetadataType > (that.value); break; - case 62: // relay6_field + case 66: // relay6_field value.copy< TokenRelay6Field::FieldType > (that.value); break; - case 45: // "constant string" - case 46: // "integer" - case 47: // "constant hexstring" - case 48: // "option name" - case 49: // "ip address" + case 47: // "constant string" + case 48: // "integer" + case 49: // "constant hexstring" + case 50: // "option name" + case 51: // "ip address" value.copy< std::string > (that.value); break; - case 55: // option_code + case 59: // option_code value.copy< uint16_t > (that.value); break; - case 54: // integer_expr - case 59: // enterprise_id + case 58: // integer_expr + case 63: // enterprise_id value.copy< uint32_t > (that.value); break; - case 57: // nest_level + case 61: // nest_level value.copy< uint8_t > (that.value); break; @@ -386,100 +386,100 @@ namespace isc { namespace eval { << yysym.location << ": "; switch (yytype) { - case 45: // "constant string" + case 47: // "constant string" -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< std::string > (); } #line 394 "parser.cc" // lalr1.cc:636 break; - case 46: // "integer" + case 48: // "integer" -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< std::string > (); } #line 401 "parser.cc" // lalr1.cc:636 break; - case 47: // "constant hexstring" + case 49: // "constant hexstring" -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< std::string > (); } #line 408 "parser.cc" // lalr1.cc:636 break; - case 48: // "option name" + case 50: // "option name" -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< std::string > (); } #line 415 "parser.cc" // lalr1.cc:636 break; - case 49: // "ip address" + case 51: // "ip address" -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< std::string > (); } #line 422 "parser.cc" // lalr1.cc:636 break; - case 54: // integer_expr + case 58: // integer_expr -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< uint32_t > (); } #line 429 "parser.cc" // lalr1.cc:636 break; - case 55: // option_code + case 59: // option_code -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< uint16_t > (); } #line 436 "parser.cc" // lalr1.cc:636 break; - case 56: // option_repr_type + case 60: // option_repr_type -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< TokenOption::RepresentationType > (); } #line 443 "parser.cc" // lalr1.cc:636 break; - case 57: // nest_level + case 61: // nest_level -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< uint8_t > (); } #line 450 "parser.cc" // lalr1.cc:636 break; - case 58: // pkt_metadata + case 62: // pkt_metadata -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< TokenPkt::MetadataType > (); } #line 457 "parser.cc" // lalr1.cc:636 break; - case 59: // enterprise_id + case 63: // enterprise_id -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< uint32_t > (); } #line 464 "parser.cc" // lalr1.cc:636 break; - case 60: // pkt4_field + case 64: // pkt4_field -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< TokenPkt4::FieldType > (); } #line 471 "parser.cc" // lalr1.cc:636 break; - case 61: // pkt6_field + case 65: // pkt6_field -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< TokenPkt6::FieldType > (); } #line 478 "parser.cc" // lalr1.cc:636 break; - case 62: // relay6_field + case 66: // relay6_field -#line 105 "parser.yy" // lalr1.cc:636 +#line 108 "parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< TokenRelay6Field::FieldType > (); } #line 485 "parser.cc" // lalr1.cc:636 break; @@ -681,44 +681,44 @@ namespace isc { namespace eval { when using variants. */ switch (yyr1_[yyn]) { - case 56: // option_repr_type + case 60: // option_repr_type yylhs.value.build< TokenOption::RepresentationType > (); break; - case 60: // pkt4_field + case 64: // pkt4_field yylhs.value.build< TokenPkt4::FieldType > (); break; - case 61: // pkt6_field + case 65: // pkt6_field yylhs.value.build< TokenPkt6::FieldType > (); break; - case 58: // pkt_metadata + case 62: // pkt_metadata yylhs.value.build< TokenPkt::MetadataType > (); break; - case 62: // relay6_field + case 66: // relay6_field yylhs.value.build< TokenRelay6Field::FieldType > (); break; - case 45: // "constant string" - case 46: // "integer" - case 47: // "constant hexstring" - case 48: // "option name" - case 49: // "ip address" + case 47: // "constant string" + case 48: // "integer" + case 49: // "constant hexstring" + case 50: // "option name" + case 51: // "ip address" yylhs.value.build< std::string > (); break; - case 55: // option_code + case 59: // option_code yylhs.value.build< uint16_t > (); break; - case 54: // integer_expr - case 59: // enterprise_id + case 58: // integer_expr + case 63: // enterprise_id yylhs.value.build< uint32_t > (); break; - case 57: // nest_level + case 61: // nest_level yylhs.value.build< uint8_t > (); break; @@ -739,8 +739,8 @@ namespace isc { namespace eval { { switch (yyn) { - case 4: -#line 119 "parser.yy" // lalr1.cc:859 + case 8: +#line 134 "parser.yy" // lalr1.cc:859 { TokenPtr neg(new TokenNot()); ctx.expression.push_back(neg); @@ -748,8 +748,8 @@ namespace isc { namespace eval { #line 749 "parser.cc" // lalr1.cc:859 break; - case 5: -#line 124 "parser.yy" // lalr1.cc:859 + case 9: +#line 139 "parser.yy" // lalr1.cc:859 { TokenPtr neg(new TokenAnd()); ctx.expression.push_back(neg); @@ -757,8 +757,8 @@ namespace isc { namespace eval { #line 758 "parser.cc" // lalr1.cc:859 break; - case 6: -#line 129 "parser.yy" // lalr1.cc:859 + case 10: +#line 144 "parser.yy" // lalr1.cc:859 { TokenPtr neg(new TokenOr()); ctx.expression.push_back(neg); @@ -766,8 +766,8 @@ namespace isc { namespace eval { #line 767 "parser.cc" // lalr1.cc:859 break; - case 7: -#line 134 "parser.yy" // lalr1.cc:859 + case 11: +#line 149 "parser.yy" // lalr1.cc:859 { TokenPtr eq(new TokenEqual()); ctx.expression.push_back(eq); @@ -775,8 +775,8 @@ namespace isc { namespace eval { #line 776 "parser.cc" // lalr1.cc:859 break; - case 8: -#line 139 "parser.yy" // lalr1.cc:859 + case 12: +#line 154 "parser.yy" // lalr1.cc:859 { TokenPtr opt(new TokenOption(yystack_[3].value.as< uint16_t > (), TokenOption::EXISTS)); ctx.expression.push_back(opt); @@ -784,8 +784,8 @@ namespace isc { namespace eval { #line 785 "parser.cc" // lalr1.cc:859 break; - case 9: -#line 144 "parser.yy" // lalr1.cc:859 + case 13: +#line 159 "parser.yy" // lalr1.cc:859 { switch (ctx.getUniverse()) { case Option::V4: @@ -808,8 +808,8 @@ namespace isc { namespace eval { #line 809 "parser.cc" // lalr1.cc:859 break; - case 10: -#line 164 "parser.yy" // lalr1.cc:859 + case 14: +#line 179 "parser.yy" // lalr1.cc:859 { switch (ctx.getUniverse()) { case Option::V6: @@ -826,8 +826,8 @@ namespace isc { namespace eval { #line 827 "parser.cc" // lalr1.cc:859 break; - case 11: -#line 178 "parser.yy" // lalr1.cc:859 + case 15: +#line 193 "parser.yy" // lalr1.cc:859 { // Expression: vendor-class[1234].exists // @@ -839,8 +839,8 @@ namespace isc { namespace eval { #line 840 "parser.cc" // lalr1.cc:859 break; - case 12: -#line 187 "parser.yy" // lalr1.cc:859 + case 16: +#line 202 "parser.yy" // lalr1.cc:859 { // Expression: vendor[1234].exists // @@ -852,8 +852,8 @@ namespace isc { namespace eval { #line 853 "parser.cc" // lalr1.cc:859 break; - case 13: -#line 196 "parser.yy" // lalr1.cc:859 + case 17: +#line 211 "parser.yy" // lalr1.cc:859 { // Expression vendor[1234].option[123].exists // @@ -866,8 +866,8 @@ namespace isc { namespace eval { #line 867 "parser.cc" // lalr1.cc:859 break; - case 14: -#line 208 "parser.yy" // lalr1.cc:859 + case 18: +#line 223 "parser.yy" // lalr1.cc:859 { TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ())); ctx.expression.push_back(str); @@ -875,8 +875,8 @@ namespace isc { namespace eval { #line 876 "parser.cc" // lalr1.cc:859 break; - case 15: -#line 213 "parser.yy" // lalr1.cc:859 + case 19: +#line 228 "parser.yy" // lalr1.cc:859 { TokenPtr hex(new TokenHexString(yystack_[0].value.as< std::string > ())); ctx.expression.push_back(hex); @@ -884,8 +884,8 @@ namespace isc { namespace eval { #line 885 "parser.cc" // lalr1.cc:859 break; - case 16: -#line 218 "parser.yy" // lalr1.cc:859 + case 20: +#line 233 "parser.yy" // lalr1.cc:859 { TokenPtr ip(new TokenIpAddress(yystack_[0].value.as< std::string > ())); ctx.expression.push_back(ip); @@ -893,8 +893,8 @@ namespace isc { namespace eval { #line 894 "parser.cc" // lalr1.cc:859 break; - case 17: -#line 223 "parser.yy" // lalr1.cc:859 + case 21: +#line 238 "parser.yy" // lalr1.cc:859 { TokenPtr opt(new TokenOption(yystack_[3].value.as< uint16_t > (), yystack_[0].value.as< TokenOption::RepresentationType > ())); ctx.expression.push_back(opt); @@ -902,8 +902,8 @@ namespace isc { namespace eval { #line 903 "parser.cc" // lalr1.cc:859 break; - case 18: -#line 228 "parser.yy" // lalr1.cc:859 + case 22: +#line 243 "parser.yy" // lalr1.cc:859 { switch (ctx.getUniverse()) { case Option::V4: @@ -926,8 +926,8 @@ namespace isc { namespace eval { #line 927 "parser.cc" // lalr1.cc:859 break; - case 19: -#line 249 "parser.yy" // lalr1.cc:859 + case 23: +#line 264 "parser.yy" // lalr1.cc:859 { switch (ctx.getUniverse()) { case Option::V6: @@ -944,8 +944,8 @@ namespace isc { namespace eval { #line 945 "parser.cc" // lalr1.cc:859 break; - case 20: -#line 264 "parser.yy" // lalr1.cc:859 + case 24: +#line 279 "parser.yy" // lalr1.cc:859 { TokenPtr pkt_metadata(new TokenPkt(yystack_[0].value.as< TokenPkt::MetadataType > ())); ctx.expression.push_back(pkt_metadata); @@ -953,8 +953,8 @@ namespace isc { namespace eval { #line 954 "parser.cc" // lalr1.cc:859 break; - case 21: -#line 269 "parser.yy" // lalr1.cc:859 + case 25: +#line 284 "parser.yy" // lalr1.cc:859 { switch (ctx.getUniverse()) { case Option::V4: @@ -971,8 +971,8 @@ namespace isc { namespace eval { #line 972 "parser.cc" // lalr1.cc:859 break; - case 22: -#line 283 "parser.yy" // lalr1.cc:859 + case 26: +#line 298 "parser.yy" // lalr1.cc:859 { switch (ctx.getUniverse()) { case Option::V6: @@ -989,8 +989,8 @@ namespace isc { namespace eval { #line 990 "parser.cc" // lalr1.cc:859 break; - case 23: -#line 297 "parser.yy" // lalr1.cc:859 + case 27: +#line 312 "parser.yy" // lalr1.cc:859 { switch (ctx.getUniverse()) { case Option::V6: @@ -1007,8 +1007,8 @@ namespace isc { namespace eval { #line 1008 "parser.cc" // lalr1.cc:859 break; - case 24: -#line 312 "parser.yy" // lalr1.cc:859 + case 28: +#line 327 "parser.yy" // lalr1.cc:859 { TokenPtr sub(new TokenSubstring()); ctx.expression.push_back(sub); @@ -1016,8 +1016,8 @@ namespace isc { namespace eval { #line 1017 "parser.cc" // lalr1.cc:859 break; - case 25: -#line 317 "parser.yy" // lalr1.cc:859 + case 29: +#line 332 "parser.yy" // lalr1.cc:859 { TokenPtr conc(new TokenConcat()); ctx.expression.push_back(conc); @@ -1025,8 +1025,8 @@ namespace isc { namespace eval { #line 1026 "parser.cc" // lalr1.cc:859 break; - case 26: -#line 322 "parser.yy" // lalr1.cc:859 + case 30: +#line 337 "parser.yy" // lalr1.cc:859 { // expression: vendor.enterprise // @@ -1038,8 +1038,8 @@ namespace isc { namespace eval { #line 1039 "parser.cc" // lalr1.cc:859 break; - case 27: -#line 331 "parser.yy" // lalr1.cc:859 + case 31: +#line 346 "parser.yy" // lalr1.cc:859 { // expression: vendor-class.enterprise // @@ -1052,8 +1052,8 @@ namespace isc { namespace eval { #line 1053 "parser.cc" // lalr1.cc:859 break; - case 28: -#line 341 "parser.yy" // lalr1.cc:859 + case 32: +#line 356 "parser.yy" // lalr1.cc:859 { // This token will search for vendor option with // specified enterprise-id. If found, will search @@ -1065,8 +1065,8 @@ namespace isc { namespace eval { #line 1066 "parser.cc" // lalr1.cc:859 break; - case 29: -#line 350 "parser.yy" // lalr1.cc:859 + case 33: +#line 365 "parser.yy" // lalr1.cc:859 { // expression: vendor-class[1234].data // @@ -1082,8 +1082,8 @@ namespace isc { namespace eval { #line 1083 "parser.cc" // lalr1.cc:859 break; - case 30: -#line 363 "parser.yy" // lalr1.cc:859 + case 34: +#line 378 "parser.yy" // lalr1.cc:859 { // expression: vendor-class[1234].data[5] // @@ -1099,8 +1099,8 @@ namespace isc { namespace eval { #line 1100 "parser.cc" // lalr1.cc:859 break; - case 31: -#line 376 "parser.yy" // lalr1.cc:859 + case 35: +#line 391 "parser.yy" // lalr1.cc:859 { TokenPtr integer(new TokenInteger(yystack_[0].value.as< uint32_t > ())); ctx.expression.push_back(integer); @@ -1108,208 +1108,208 @@ namespace isc { namespace eval { #line 1109 "parser.cc" // lalr1.cc:859 break; - case 32: -#line 383 "parser.yy" // lalr1.cc:859 + case 36: +#line 398 "parser.yy" // lalr1.cc:859 { yylhs.value.as< uint32_t > () = ctx.convertUint32(yystack_[0].value.as< std::string > (), yystack_[0].location); } #line 1117 "parser.cc" // lalr1.cc:859 break; - case 33: -#line 389 "parser.yy" // lalr1.cc:859 + case 37: +#line 404 "parser.yy" // lalr1.cc:859 { yylhs.value.as< uint16_t > () = ctx.convertOptionCode(yystack_[0].value.as< std::string > (), yystack_[0].location); } #line 1125 "parser.cc" // lalr1.cc:859 break; - case 34: -#line 393 "parser.yy" // lalr1.cc:859 + case 38: +#line 408 "parser.yy" // lalr1.cc:859 { yylhs.value.as< uint16_t > () = ctx.convertOptionName(yystack_[0].value.as< std::string > (), yystack_[0].location); } #line 1133 "parser.cc" // lalr1.cc:859 break; - case 35: -#line 399 "parser.yy" // lalr1.cc:859 + case 39: +#line 414 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenOption::RepresentationType > () = TokenOption::TEXTUAL; } #line 1141 "parser.cc" // lalr1.cc:859 break; - case 36: -#line 403 "parser.yy" // lalr1.cc:859 + case 40: +#line 418 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenOption::RepresentationType > () = TokenOption::HEXADECIMAL; } #line 1149 "parser.cc" // lalr1.cc:859 break; - case 37: -#line 409 "parser.yy" // lalr1.cc:859 + case 41: +#line 424 "parser.yy" // lalr1.cc:859 { yylhs.value.as< uint8_t > () = ctx.convertNestLevelNumber(yystack_[0].value.as< std::string > (), yystack_[0].location); } #line 1157 "parser.cc" // lalr1.cc:859 break; - case 38: -#line 418 "parser.yy" // lalr1.cc:859 + case 42: +#line 433 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::IFACE; } #line 1165 "parser.cc" // lalr1.cc:859 break; - case 39: -#line 422 "parser.yy" // lalr1.cc:859 + case 43: +#line 437 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::SRC; } #line 1173 "parser.cc" // lalr1.cc:859 break; - case 40: -#line 426 "parser.yy" // lalr1.cc:859 + case 44: +#line 441 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::DST; } #line 1181 "parser.cc" // lalr1.cc:859 break; - case 41: -#line 430 "parser.yy" // lalr1.cc:859 + case 45: +#line 445 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::LEN; } #line 1189 "parser.cc" // lalr1.cc:859 break; - case 42: -#line 436 "parser.yy" // lalr1.cc:859 + case 46: +#line 451 "parser.yy" // lalr1.cc:859 { yylhs.value.as< uint32_t > () = ctx.convertUint32(yystack_[0].value.as< std::string > (), yystack_[0].location); } #line 1197 "parser.cc" // lalr1.cc:859 break; - case 43: -#line 440 "parser.yy" // lalr1.cc:859 + case 47: +#line 455 "parser.yy" // lalr1.cc:859 { yylhs.value.as< uint32_t > () = 0; } #line 1205 "parser.cc" // lalr1.cc:859 break; - case 44: -#line 446 "parser.yy" // lalr1.cc:859 + case 48: +#line 461 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::CHADDR; } #line 1213 "parser.cc" // lalr1.cc:859 break; - case 45: -#line 450 "parser.yy" // lalr1.cc:859 + case 49: +#line 465 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::HLEN; } #line 1221 "parser.cc" // lalr1.cc:859 break; - case 46: -#line 454 "parser.yy" // lalr1.cc:859 + case 50: +#line 469 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::HTYPE; } #line 1229 "parser.cc" // lalr1.cc:859 break; - case 47: -#line 458 "parser.yy" // lalr1.cc:859 + case 51: +#line 473 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::CIADDR; } #line 1237 "parser.cc" // lalr1.cc:859 break; - case 48: -#line 462 "parser.yy" // lalr1.cc:859 + case 52: +#line 477 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::GIADDR; } #line 1245 "parser.cc" // lalr1.cc:859 break; - case 49: -#line 466 "parser.yy" // lalr1.cc:859 + case 53: +#line 481 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::YIADDR; } #line 1253 "parser.cc" // lalr1.cc:859 break; - case 50: -#line 470 "parser.yy" // lalr1.cc:859 + case 54: +#line 485 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::SIADDR; } #line 1261 "parser.cc" // lalr1.cc:859 break; - case 51: -#line 474 "parser.yy" // lalr1.cc:859 + case 55: +#line 489 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::MSGTYPE; } #line 1269 "parser.cc" // lalr1.cc:859 break; - case 52: -#line 478 "parser.yy" // lalr1.cc:859 + case 56: +#line 493 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::TRANSID; } #line 1277 "parser.cc" // lalr1.cc:859 break; - case 53: -#line 484 "parser.yy" // lalr1.cc:859 + case 57: +#line 499 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt6::FieldType > () = TokenPkt6::MSGTYPE; } #line 1285 "parser.cc" // lalr1.cc:859 break; - case 54: -#line 488 "parser.yy" // lalr1.cc:859 + case 58: +#line 503 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenPkt6::FieldType > () = TokenPkt6::TRANSID; } #line 1293 "parser.cc" // lalr1.cc:859 break; - case 55: -#line 494 "parser.yy" // lalr1.cc:859 + case 59: +#line 509 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenRelay6Field::FieldType > () = TokenRelay6Field::PEERADDR; } #line 1301 "parser.cc" // lalr1.cc:859 break; - case 56: -#line 498 "parser.yy" // lalr1.cc:859 + case 60: +#line 513 "parser.yy" // lalr1.cc:859 { yylhs.value.as< TokenRelay6Field::FieldType > () = TokenRelay6Field::LINKADDR; } #line 1309 "parser.cc" // lalr1.cc:859 break; - case 57: -#line 504 "parser.yy" // lalr1.cc:859 + case 61: +#line 519 "parser.yy" // lalr1.cc:859 { TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ())); ctx.expression.push_back(str); @@ -1317,8 +1317,8 @@ namespace isc { namespace eval { #line 1318 "parser.cc" // lalr1.cc:859 break; - case 58: -#line 511 "parser.yy" // lalr1.cc:859 + case 62: +#line 526 "parser.yy" // lalr1.cc:859 { TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ())); ctx.expression.push_back(str); @@ -1326,8 +1326,8 @@ namespace isc { namespace eval { #line 1327 "parser.cc" // lalr1.cc:859 break; - case 59: -#line 516 "parser.yy" // lalr1.cc:859 + case 63: +#line 531 "parser.yy" // lalr1.cc:859 { TokenPtr str(new TokenString("all")); ctx.expression.push_back(str); @@ -1591,153 +1591,158 @@ namespace isc { namespace eval { } - const signed char EvalParser::yypact_ninf_ = -91; + const signed char EvalParser::yypact_ninf_ = -98; const signed char EvalParser::yytable_ninf_ = -1; const short int EvalParser::yypact_[] = { - 3, 3, 3, -5, 13, 23, 4, 14, 54, 80, - 68, 37, 95, -91, -91, -91, -91, 93, 35, 98, - -91, 73, -91, 67, 67, 64, 50, 69, 45, 45, - 84, -20, 74, -20, 81, -91, 3, 3, 45, -91, - -91, -91, 109, 111, -91, 112, -91, -91, -91, -91, - -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, - -91, 114, 115, 116, 100, 103, 96, 97, -91, -91, - -91, -91, -91, 118, -91, 119, -91, -91, 129, -91, - 120, 121, 122, 67, 67, 64, -20, -20, 94, 45, - 123, 125, 16, 28, 6, 127, 128, 130, 131, 132, - -91, 113, 140, -14, -2, -91, -91, -91, -91, -91, - -91, 135, -91, -91, -91, 134, 136, 137, 138, 139, - -30, -91, -91, 142, 143, -91, 67, 58, 58, 12, - 108, 149, -91, -91, 155, 117, 67, 145, 147, 148, - -91, 150, 151, 152, 67, 67, -91, 153, 70, 156, - 157, 86, -91, -91, 154, 158, -91, -91, 58, 58 + -23, 41, 41, 36, 41, 41, 28, 31, 35, 56, + 60, 92, 93, 84, -8, 59, -98, -98, -98, -98, + -98, 47, 55, -98, -98, 47, 55, -98, 58, -98, + 43, 43, 61, 17, -14, 88, 88, 48, -22, 73, + -22, 74, 41, 41, 88, -98, -98, -98, 107, 108, + -98, 111, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, 113, 116, 117, + 91, 96, 71, 98, -98, -98, -98, -98, -98, 119, + -98, 123, -98, -98, 126, -98, 124, 125, 127, 43, + 43, 61, -22, -22, 94, 88, 128, 129, 52, 66, + 18, 131, 132, 133, 134, 135, -98, 118, 147, -15, + 2, -98, -98, -98, -98, -98, -98, 138, -98, -98, + -98, 139, 140, 141, 142, 143, -29, -98, -98, 146, + 148, -98, 43, 62, 62, 20, 120, 145, -98, -98, + 157, 121, 43, 149, 151, 152, -98, 153, 155, 156, + 43, 43, -98, 158, 85, 160, 161, 97, -98, -98, + 162, 163, -98, -98, 62, 62 }; const unsigned char EvalParser::yydefact_[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 14, 32, 15, 16, 0, 2, 0, - 31, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, - 33, 34, 0, 0, 37, 0, 38, 39, 40, 41, - 20, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 21, 0, 0, 0, 0, 0, 0, 0, 53, 54, - 22, 43, 42, 0, 27, 0, 26, 5, 6, 7, + 0, 0, 0, 0, 0, 0, 18, 36, 19, 20, + 2, 6, 0, 35, 3, 4, 5, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7, 37, 38, 0, 0, + 41, 0, 42, 43, 44, 45, 24, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 25, 0, 0, 0, + 0, 0, 0, 0, 57, 58, 26, 47, 46, 0, + 31, 0, 30, 9, 10, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 57, 0, 0, 0, 0, 35, 36, 8, 17, 9, - 18, 0, 55, 56, 23, 0, 0, 0, 0, 0, - 0, 25, 11, 29, 0, 12, 0, 0, 0, 0, - 0, 0, 59, 58, 0, 0, 0, 0, 0, 0, - 24, 0, 0, 0, 0, 0, 30, 0, 0, 0, - 0, 0, 10, 19, 0, 0, 13, 28, 0, 0 + 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, + 0, 39, 40, 12, 21, 13, 22, 0, 59, 60, + 27, 0, 0, 0, 0, 0, 0, 29, 15, 33, + 0, 16, 0, 0, 0, 0, 0, 0, 63, 62, + 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, + 0, 0, 34, 0, 0, 0, 0, 0, 14, 23, + 0, 0, 17, 32, 0, 0 }; const signed char EvalParser::yypgoto_[] = { - -91, -91, 30, -27, -91, -24, -90, 79, -91, -23, - -91, -91, -91, -91, -91 + -98, -98, -98, -98, 5, -1, -98, -31, -97, 76, + -98, -37, -98, -98, -98, -98, -98 }; const short int EvalParser::yydefgoto_[] = { - -1, 17, 18, 19, 20, 42, 108, 45, 50, 73, - 60, 70, 114, 101, 134 + -1, 3, 24, 20, 21, 22, 23, 48, 114, 51, + 56, 79, 66, 76, 120, 107, 140 }; const unsigned char EvalParser::yytable_[] = { - 43, 66, 67, 110, 132, 122, 1, 124, 2, 23, - 75, 79, 3, 4, 5, 111, 133, 125, 112, 113, - 26, 138, 71, 6, 112, 113, 72, 24, 7, 123, - 27, 21, 22, 105, 106, 107, 8, 25, 110, 9, - 10, 36, 37, 11, 12, 105, 106, 109, 13, 14, - 15, 31, 16, 32, 61, 62, 63, 28, 153, 95, - 96, 157, 102, 98, 99, 6, 77, 78, 153, 157, - 7, 46, 47, 48, 49, 105, 106, 39, 8, 36, - 37, 9, 10, 29, 30, 64, 65, 105, 106, 152, - 13, 14, 15, 35, 16, 51, 52, 53, 54, 55, - 56, 57, 137, 105, 106, 156, 38, 58, 59, 33, - 44, 34, 142, 40, 86, 41, 32, 87, 74, 34, - 149, 150, 68, 69, 80, 76, 81, 82, 83, 84, - 85, 88, 89, 90, 91, 36, 92, 93, 94, 103, - 100, 104, 115, 116, 121, 117, 118, 119, 120, 126, - 127, 123, 128, 129, 130, 131, 135, 136, 139, 140, - 143, 144, 145, 141, 97, 146, 147, 0, 148, 151, - 158, 154, 155, 0, 159 + 49, 26, 116, 81, 128, 138, 38, 25, 39, 28, + 29, 130, 57, 58, 59, 60, 61, 62, 63, 139, + 77, 131, 1, 2, 64, 65, 78, 117, 129, 144, + 118, 119, 118, 119, 72, 73, 27, 116, 52, 53, + 54, 55, 30, 85, 4, 31, 5, 83, 84, 32, + 6, 7, 8, 42, 43, 104, 105, 159, 101, 102, + 163, 9, 45, 44, 42, 43, 10, 159, 163, 111, + 112, 113, 33, 40, 11, 41, 34, 12, 13, 111, + 112, 14, 15, 111, 112, 115, 74, 75, 16, 17, + 18, 46, 19, 47, 108, 35, 36, 67, 68, 69, + 37, 143, 111, 112, 158, 92, 94, 39, 9, 50, + 93, 148, 41, 10, 111, 112, 162, 80, 82, 155, + 156, 11, 86, 87, 12, 13, 88, 89, 70, 71, + 90, 91, 42, 95, 96, 16, 17, 18, 97, 19, + 98, 99, 106, 100, 109, 110, 121, 122, 123, 124, + 125, 127, 132, 126, 145, 133, 134, 135, 136, 137, + 141, 146, 142, 129, 149, 150, 151, 103, 152, 147, + 153, 0, 154, 0, 157, 160, 161, 0, 164, 165 }; const short int EvalParser::yycheck_[] = { - 24, 28, 29, 93, 34, 19, 3, 9, 5, 14, - 33, 38, 9, 10, 11, 9, 46, 19, 12, 13, - 16, 9, 42, 20, 12, 13, 46, 14, 25, 43, - 16, 1, 2, 17, 18, 19, 33, 14, 128, 36, - 37, 6, 7, 40, 41, 17, 18, 19, 45, 46, - 47, 14, 49, 16, 9, 10, 11, 3, 148, 83, - 84, 151, 89, 86, 87, 20, 36, 37, 158, 159, - 25, 21, 22, 23, 24, 17, 18, 4, 33, 6, - 7, 36, 37, 3, 16, 40, 41, 17, 18, 19, - 45, 46, 47, 0, 49, 26, 27, 28, 29, 30, - 31, 32, 126, 17, 18, 19, 8, 38, 39, 14, - 46, 16, 136, 46, 14, 48, 16, 14, 44, 16, - 144, 145, 38, 39, 15, 44, 15, 15, 14, 14, - 14, 35, 35, 15, 15, 6, 16, 16, 16, 16, - 46, 16, 15, 15, 4, 15, 15, 15, 35, 14, - 16, 43, 16, 16, 16, 16, 14, 14, 9, 4, - 15, 14, 14, 46, 85, 15, 15, -1, 16, 16, - 16, 15, 15, -1, 16 + 31, 2, 99, 40, 19, 34, 14, 2, 16, 4, + 5, 9, 26, 27, 28, 29, 30, 31, 32, 48, + 42, 19, 45, 46, 38, 39, 48, 9, 43, 9, + 12, 13, 12, 13, 35, 36, 0, 134, 21, 22, + 23, 24, 14, 44, 3, 14, 5, 42, 43, 14, + 9, 10, 11, 6, 7, 92, 93, 154, 89, 90, + 157, 20, 4, 8, 6, 7, 25, 164, 165, 17, + 18, 19, 16, 14, 33, 16, 16, 36, 37, 17, + 18, 40, 41, 17, 18, 19, 38, 39, 47, 48, + 49, 48, 51, 50, 95, 3, 3, 9, 10, 11, + 16, 132, 17, 18, 19, 14, 35, 16, 20, 48, + 14, 142, 16, 25, 17, 18, 19, 44, 44, 150, + 151, 33, 15, 15, 36, 37, 15, 14, 40, 41, + 14, 14, 6, 35, 15, 47, 48, 49, 15, 51, + 16, 16, 48, 16, 16, 16, 15, 15, 15, 15, + 15, 4, 14, 35, 9, 16, 16, 16, 16, 16, + 14, 4, 14, 43, 15, 14, 14, 91, 15, 48, + 15, -1, 16, -1, 16, 15, 15, -1, 16, 16 }; const unsigned char EvalParser::yystos_[] = { - 0, 3, 5, 9, 10, 11, 20, 25, 33, 36, - 37, 40, 41, 45, 46, 47, 49, 51, 52, 53, - 54, 52, 52, 14, 14, 14, 16, 16, 3, 3, - 16, 14, 16, 14, 16, 0, 6, 7, 8, 4, - 46, 48, 55, 55, 46, 57, 21, 22, 23, 24, - 58, 26, 27, 28, 29, 30, 31, 32, 38, 39, - 60, 9, 10, 11, 40, 41, 53, 53, 38, 39, - 61, 42, 46, 59, 44, 59, 44, 52, 52, 53, - 15, 15, 15, 14, 14, 14, 14, 14, 35, 35, - 15, 15, 16, 16, 16, 55, 55, 57, 59, 59, - 46, 63, 53, 16, 16, 17, 18, 19, 56, 19, - 56, 9, 12, 13, 62, 15, 15, 15, 15, 15, - 35, 4, 19, 43, 9, 19, 14, 16, 16, 16, - 16, 16, 34, 46, 64, 14, 14, 55, 9, 9, - 4, 46, 55, 15, 14, 14, 15, 15, 16, 55, - 55, 16, 19, 56, 15, 15, 19, 56, 16, 16 + 0, 45, 46, 53, 3, 5, 9, 10, 11, 20, + 25, 33, 36, 37, 40, 41, 47, 48, 49, 51, + 55, 56, 57, 58, 54, 56, 57, 0, 56, 56, + 14, 14, 14, 16, 16, 3, 3, 16, 14, 16, + 14, 16, 6, 7, 8, 4, 48, 50, 59, 59, + 48, 61, 21, 22, 23, 24, 62, 26, 27, 28, + 29, 30, 31, 32, 38, 39, 64, 9, 10, 11, + 40, 41, 57, 57, 38, 39, 65, 42, 48, 63, + 44, 63, 44, 56, 56, 57, 15, 15, 15, 14, + 14, 14, 14, 14, 35, 35, 15, 15, 16, 16, + 16, 59, 59, 61, 63, 63, 48, 67, 57, 16, + 16, 17, 18, 19, 60, 19, 60, 9, 12, 13, + 66, 15, 15, 15, 15, 15, 35, 4, 19, 43, + 9, 19, 14, 16, 16, 16, 16, 16, 34, 48, + 68, 14, 14, 59, 9, 9, 4, 48, 59, 15, + 14, 14, 15, 15, 16, 59, 59, 16, 19, 60, + 15, 15, 19, 60, 16, 16 }; const unsigned char EvalParser::yyr1_[] = { - 0, 50, 51, 52, 52, 52, 52, 52, 52, 52, - 52, 52, 52, 52, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 54, 55, 55, 56, 56, 57, 58, 58, - 58, 58, 59, 59, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 61, 61, 62, 62, 63, 64, 64 + 0, 52, 53, 53, 54, 54, 55, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 58, 59, 59, 60, + 60, 61, 62, 62, 62, 62, 63, 63, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 65, 65, 66, + 66, 67, 68, 68 }; const unsigned char EvalParser::yyr2_[] = { - 0, 2, 1, 3, 2, 3, 3, 3, 6, 6, - 11, 6, 6, 11, 1, 1, 1, 6, 6, 11, - 3, 3, 3, 6, 8, 6, 3, 3, 11, 6, - 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 2, 2, 2, 1, 1, 1, 3, 2, 3, + 3, 3, 6, 6, 11, 6, 6, 11, 1, 1, + 1, 6, 6, 11, 3, 3, 3, 6, 8, 6, + 3, 3, 11, 6, 9, 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 }; @@ -1755,8 +1760,9 @@ namespace isc { namespace eval { "\"giaddr\"", "\"yiaddr\"", "\"siaddr\"", "\"substring\"", "\"all\"", "\",\"", "\"concat\"", "\"pkt6\"", "\"msgtype\"", "\"transid\"", "\"vendor-class\"", "\"vendor\"", "\"*\"", "\"data\"", "\"enterprise\"", - "\"constant string\"", "\"integer\"", "\"constant hexstring\"", - "\"option name\"", "\"ip address\"", "$accept", "expression", + "\"top-level bool\"", "\"top-level string\"", "\"constant string\"", + "\"integer\"", "\"constant hexstring\"", "\"option name\"", + "\"ip address\"", "$accept", "start", "string_expression", "expression", "bool_expr", "string_expr", "integer_expr", "option_code", "option_repr_type", "nest_level", "pkt_metadata", "enterprise_id", "pkt4_field", "pkt6_field", "relay6_field", "start_expr", "length_expr", YY_NULLPTR @@ -1766,12 +1772,13 @@ namespace isc { namespace eval { const unsigned short int EvalParser::yyrline_[] = { - 0, 114, 114, 117, 118, 123, 128, 133, 138, 143, - 163, 177, 186, 195, 207, 212, 217, 222, 227, 248, - 263, 268, 282, 296, 311, 316, 321, 330, 340, 349, - 362, 375, 382, 388, 392, 398, 402, 408, 417, 421, - 425, 429, 435, 439, 445, 449, 453, 457, 461, 465, - 469, 473, 477, 483, 487, 493, 497, 503, 510, 515 + 0, 117, 117, 118, 123, 124, 129, 132, 133, 138, + 143, 148, 153, 158, 178, 192, 201, 210, 222, 227, + 232, 237, 242, 263, 278, 283, 297, 311, 326, 331, + 336, 345, 355, 364, 377, 390, 397, 403, 407, 413, + 417, 423, 432, 436, 440, 444, 450, 454, 460, 464, + 468, 472, 476, 480, 484, 488, 492, 498, 502, 508, + 512, 518, 525, 530 }; // Print the state stack on the debug stream. @@ -1806,8 +1813,8 @@ namespace isc { namespace eval { #line 14 "parser.yy" // lalr1.cc:1167 } } // isc::eval -#line 1810 "parser.cc" // lalr1.cc:1167 -#line 522 "parser.yy" // lalr1.cc:1168 +#line 1817 "parser.cc" // lalr1.cc:1167 +#line 537 "parser.yy" // lalr1.cc:1168 void isc::eval::EvalParser::error(const location_type& loc, diff --git a/src/lib/eval/parser.h b/src/lib/eval/parser.h index 11458a5e7b..d799193602 100644 --- a/src/lib/eval/parser.h +++ b/src/lib/eval/parser.h @@ -40,7 +40,7 @@ #ifndef YY_EVAL_PARSER_H_INCLUDED # define YY_EVAL_PARSER_H_INCLUDED // // "%code requires" blocks. -#line 17 "parser.yy" // lalr1.cc:377 +#line 17 "parser.yy" // lalr1.cc:392 #include #include @@ -51,7 +51,7 @@ using namespace isc::dhcp; using namespace isc::eval; -#line 55 "parser.h" // lalr1.cc:377 +#line 55 "parser.h" // lalr1.cc:392 # include # include // std::abort @@ -134,9 +134,9 @@ using namespace isc::eval; # endif /* ! defined YYDEBUG */ #endif /* ! defined EVALDEBUG */ -#line 14 "parser.yy" // lalr1.cc:377 +#line 14 "parser.yy" // lalr1.cc:392 namespace isc { namespace eval { -#line 140 "parser.h" // lalr1.cc:377 +#line 140 "parser.h" // lalr1.cc:392 @@ -399,11 +399,13 @@ namespace isc { namespace eval { TOKEN_ANY = 297, TOKEN_DATA = 298, TOKEN_ENTERPRISE = 299, - TOKEN_STRING = 300, - TOKEN_INTEGER = 301, - TOKEN_HEXSTRING = 302, - TOKEN_OPTION_NAME = 303, - TOKEN_IP_ADDRESS = 304 + TOKEN_TOPLEVEL_BOOL = 300, + TOKEN_TOPLEVEL_STRING = 301, + TOKEN_STRING = 302, + TOKEN_INTEGER = 303, + TOKEN_HEXSTRING = 304, + TOKEN_OPTION_NAME = 305, + TOKEN_IP_ADDRESS = 306 }; }; @@ -698,6 +700,14 @@ namespace isc { namespace eval { symbol_type make_ENTERPRISE (const location_type& l); + static inline + symbol_type + make_TOPLEVEL_BOOL (const location_type& l); + + static inline + symbol_type + make_TOPLEVEL_STRING (const location_type& l); + static inline symbol_type make_STRING (const std::string& v, const location_type& l); @@ -923,12 +933,12 @@ namespace isc { namespace eval { enum { yyeof_ = 0, - yylast_ = 174, ///< Last index in yytable_. - yynnts_ = 15, ///< Number of nonterminal symbols. - yyfinal_ = 35, ///< Termination state number. + yylast_ = 179, ///< Last index in yytable_. + yynnts_ = 17, ///< Number of nonterminal symbols. + yyfinal_ = 27, ///< Termination state number. yyterror_ = 1, yyerrcode_ = 256, - yyntokens_ = 50 ///< Number of tokens. + yyntokens_ = 52 ///< Number of tokens. }; @@ -975,9 +985,9 @@ namespace isc { namespace eval { 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 + 45, 46, 47, 48, 49, 50, 51 }; - const unsigned int user_token_number_max_ = 304; + const unsigned int user_token_number_max_ = 306; const token_number_type undef_token_ = 2; if (static_cast(t) <= yyeof_) @@ -1010,44 +1020,44 @@ namespace isc { namespace eval { { switch (other.type_get ()) { - case 56: // option_repr_type + case 60: // option_repr_type value.copy< TokenOption::RepresentationType > (other.value); break; - case 60: // pkt4_field + case 64: // pkt4_field value.copy< TokenPkt4::FieldType > (other.value); break; - case 61: // pkt6_field + case 65: // pkt6_field value.copy< TokenPkt6::FieldType > (other.value); break; - case 58: // pkt_metadata + case 62: // pkt_metadata value.copy< TokenPkt::MetadataType > (other.value); break; - case 62: // relay6_field + case 66: // relay6_field value.copy< TokenRelay6Field::FieldType > (other.value); break; - case 45: // "constant string" - case 46: // "integer" - case 47: // "constant hexstring" - case 48: // "option name" - case 49: // "ip address" + case 47: // "constant string" + case 48: // "integer" + case 49: // "constant hexstring" + case 50: // "option name" + case 51: // "ip address" value.copy< std::string > (other.value); break; - case 55: // option_code + case 59: // option_code value.copy< uint16_t > (other.value); break; - case 54: // integer_expr - case 59: // enterprise_id + case 58: // integer_expr + case 63: // enterprise_id value.copy< uint32_t > (other.value); break; - case 57: // nest_level + case 61: // nest_level value.copy< uint8_t > (other.value); break; @@ -1068,44 +1078,44 @@ namespace isc { namespace eval { (void) v; switch (this->type_get ()) { - case 56: // option_repr_type + case 60: // option_repr_type value.copy< TokenOption::RepresentationType > (v); break; - case 60: // pkt4_field + case 64: // pkt4_field value.copy< TokenPkt4::FieldType > (v); break; - case 61: // pkt6_field + case 65: // pkt6_field value.copy< TokenPkt6::FieldType > (v); break; - case 58: // pkt_metadata + case 62: // pkt_metadata value.copy< TokenPkt::MetadataType > (v); break; - case 62: // relay6_field + case 66: // relay6_field value.copy< TokenRelay6Field::FieldType > (v); break; - case 45: // "constant string" - case 46: // "integer" - case 47: // "constant hexstring" - case 48: // "option name" - case 49: // "ip address" + case 47: // "constant string" + case 48: // "integer" + case 49: // "constant hexstring" + case 50: // "option name" + case 51: // "ip address" value.copy< std::string > (v); break; - case 55: // option_code + case 59: // option_code value.copy< uint16_t > (v); break; - case 54: // integer_expr - case 59: // enterprise_id + case 58: // integer_expr + case 63: // enterprise_id value.copy< uint32_t > (v); break; - case 57: // nest_level + case 61: // nest_level value.copy< uint8_t > (v); break; @@ -1213,44 +1223,44 @@ namespace isc { namespace eval { // Type destructor. switch (yytype) { - case 56: // option_repr_type + case 60: // option_repr_type value.template destroy< TokenOption::RepresentationType > (); break; - case 60: // pkt4_field + case 64: // pkt4_field value.template destroy< TokenPkt4::FieldType > (); break; - case 61: // pkt6_field + case 65: // pkt6_field value.template destroy< TokenPkt6::FieldType > (); break; - case 58: // pkt_metadata + case 62: // pkt_metadata value.template destroy< TokenPkt::MetadataType > (); break; - case 62: // relay6_field + case 66: // relay6_field value.template destroy< TokenRelay6Field::FieldType > (); break; - case 45: // "constant string" - case 46: // "integer" - case 47: // "constant hexstring" - case 48: // "option name" - case 49: // "ip address" + case 47: // "constant string" + case 48: // "integer" + case 49: // "constant hexstring" + case 50: // "option name" + case 51: // "ip address" value.template destroy< std::string > (); break; - case 55: // option_code + case 59: // option_code value.template destroy< uint16_t > (); break; - case 54: // integer_expr - case 59: // enterprise_id + case 58: // integer_expr + case 63: // enterprise_id value.template destroy< uint32_t > (); break; - case 57: // nest_level + case 61: // nest_level value.template destroy< uint8_t > (); break; @@ -1277,44 +1287,44 @@ namespace isc { namespace eval { super_type::move(s); switch (this->type_get ()) { - case 56: // option_repr_type + case 60: // option_repr_type value.move< TokenOption::RepresentationType > (s.value); break; - case 60: // pkt4_field + case 64: // pkt4_field value.move< TokenPkt4::FieldType > (s.value); break; - case 61: // pkt6_field + case 65: // pkt6_field value.move< TokenPkt6::FieldType > (s.value); break; - case 58: // pkt_metadata + case 62: // pkt_metadata value.move< TokenPkt::MetadataType > (s.value); break; - case 62: // relay6_field + case 66: // relay6_field value.move< TokenRelay6Field::FieldType > (s.value); break; - case 45: // "constant string" - case 46: // "integer" - case 47: // "constant hexstring" - case 48: // "option name" - case 49: // "ip address" + case 47: // "constant string" + case 48: // "integer" + case 49: // "constant hexstring" + case 50: // "option name" + case 51: // "ip address" value.move< std::string > (s.value); break; - case 55: // option_code + case 59: // option_code value.move< uint16_t > (s.value); break; - case 54: // integer_expr - case 59: // enterprise_id + case 58: // integer_expr + case 63: // enterprise_id value.move< uint32_t > (s.value); break; - case 57: // nest_level + case 61: // nest_level value.move< uint8_t > (s.value); break; @@ -1377,7 +1387,8 @@ namespace isc { namespace eval { 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 + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306 }; return static_cast (yytoken_number_[type]); } @@ -1640,6 +1651,18 @@ namespace isc { namespace eval { return symbol_type (token::TOKEN_ENTERPRISE, l); } + EvalParser::symbol_type + EvalParser::make_TOPLEVEL_BOOL (const location_type& l) + { + return symbol_type (token::TOKEN_TOPLEVEL_BOOL, l); + } + + EvalParser::symbol_type + EvalParser::make_TOPLEVEL_STRING (const location_type& l) + { + return symbol_type (token::TOKEN_TOPLEVEL_STRING, l); + } + EvalParser::symbol_type EvalParser::make_STRING (const std::string& v, const location_type& l) { @@ -1671,9 +1694,9 @@ namespace isc { namespace eval { } -#line 14 "parser.yy" // lalr1.cc:377 +#line 14 "parser.yy" // lalr1.cc:392 } } // isc::eval -#line 1677 "parser.h" // lalr1.cc:377 +#line 1700 "parser.h" // lalr1.cc:392 diff --git a/src/lib/eval/position.hh b/src/lib/eval/position.hh index 7be7a75107..6807f9f15a 100644 --- a/src/lib/eval/position.hh +++ b/src/lib/eval/position.hh @@ -1,4 +1,3 @@ -// Generated 201702011420 // A Bison parser, made by GNU Bison 3.0.4. // Positions for Bison parsers in C++ @@ -51,9 +50,9 @@ # endif # endif -#line 14 "parser.yy" // location.cc:296 +#line 14 "parser.yy" // location.cc:337 namespace isc { namespace eval { -#line 56 "position.hh" // location.cc:296 +#line 56 "position.hh" // location.cc:337 /// Abstract a position. class position { @@ -175,7 +174,7 @@ namespace isc { namespace eval { return ostr << pos.line << '.' << pos.column; } -#line 14 "parser.yy" // location.cc:296 +#line 14 "parser.yy" // location.cc:337 } } // isc::eval -#line 180 "position.hh" // location.cc:296 +#line 180 "position.hh" // location.cc:337 #endif // !YY_EVAL_POSITION_HH_INCLUDED diff --git a/src/lib/eval/stack.hh b/src/lib/eval/stack.hh index 75f1692f93..7c11d0ffef 100644 --- a/src/lib/eval/stack.hh +++ b/src/lib/eval/stack.hh @@ -1,4 +1,3 @@ -// Generated 201702011420 // A Bison parser, made by GNU Bison 3.0.4. // Stack handling for Bison parsers in C++ @@ -41,9 +40,9 @@ # include -#line 14 "parser.yy" // stack.hh:132 +#line 14 "parser.yy" // stack.hh:151 namespace isc { namespace eval { -#line 46 "stack.hh" // stack.hh:132 +#line 46 "stack.hh" // stack.hh:151 template > class stack { @@ -151,8 +150,8 @@ namespace isc { namespace eval { unsigned int range_; }; -#line 14 "parser.yy" // stack.hh:132 +#line 14 "parser.yy" // stack.hh:151 } } // isc::eval -#line 156 "stack.hh" // stack.hh:132 +#line 156 "stack.hh" // stack.hh:151 #endif // !YY_EVAL_STACK_HH_INCLUDED