#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 39
+#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
+typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
#define UINT32_MAX (4294967295U)
#endif
-#endif /* ! C99 */
-
#endif /* ! FLEXINT_H */
/* %endif */
*/
#define YY_LESS_LINENO(n) \
do { \
- int yyl;\
+ yy_size_t yyl;\
for ( yyl = n; yyl < yyleng; ++yyl )\
if ( yytext[yyl] == '\n' )\
--yylineno;\
}while(0)
- #define YY_LINENO_REWIND_TO(dst) \
- do {\
- const char *p;\
- for ( p = yy_cp-1; p >= (dst); --p)\
- if ( *p == '\n' )\
- --yylineno;\
- }while(0)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
/* Begin user sect3 */
-#define yywrap() 1
+#define yywrap(n) 1
#define YY_SKIP_YYWRAP
#define FLEX_DEBUG
extern char *yytext;
#define yytext_ptr yytext
-/* %% [1.5] DFA */
-
/* %if-c-only Standard (non-C++) definition */
static yy_state_type yy_get_previous_state (void );
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
- yyleng = (size_t) (yy_cp - yy_bp); \
+ yyleng = (yy_size_t) (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 16
-#define YY_END_OF_BUFFER 17
+#define YY_NUM_RULES 18
+#define YY_END_OF_BUFFER 19
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[44] =
+static yyconst flex_int16_t yy_accept[52] =
{ 0,
- 0, 0, 17, 15, 1, 2, 15, 10, 11, 14,
- 15, 5, 5, 15, 12, 13, 15, 15, 15, 1,
- 2, 0, 3, 5, 0, 6, 0, 0, 0, 4,
- 9, 0, 0, 0, 0, 0, 0, 7, 0, 0,
- 0, 8, 0
+ 0, 0, 19, 17, 1, 2, 17, 12, 13, 16,
+ 17, 17, 5, 5, 17, 14, 15, 17, 17, 17,
+ 1, 2, 0, 3, 5, 0, 0, 0, 6, 0,
+ 0, 0, 0, 0, 4, 11, 0, 0, 9, 0,
+ 0, 0, 8, 0, 0, 7, 0, 0, 0, 10,
+ 0
} ;
static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 1, 1, 1, 1, 1, 1, 4, 5,
- 6, 1, 1, 7, 8, 1, 1, 9, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 1, 1, 1,
- 11, 1, 1, 1, 12, 12, 12, 12, 12, 12,
+ 6, 1, 1, 7, 8, 9, 1, 10, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 1, 1, 1,
+ 12, 1, 1, 1, 13, 13, 13, 13, 13, 13,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 13, 1, 1,
- 14, 1, 15, 1, 1, 1, 16, 17, 12, 12,
+ 1, 1, 1, 1, 1, 1, 1, 14, 1, 1,
+ 15, 1, 16, 1, 1, 1, 17, 18, 13, 13,
- 12, 12, 18, 1, 19, 1, 1, 20, 1, 21,
- 22, 23, 1, 24, 25, 26, 27, 1, 1, 13,
+ 19, 13, 20, 21, 22, 1, 1, 23, 1, 24,
+ 25, 26, 1, 27, 28, 29, 30, 1, 1, 31,
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
} ;
-static yyconst flex_int32_t yy_meta[28] =
+static yyconst flex_int32_t yy_meta[32] =
{ 0,
- 1, 1, 2, 1, 1, 1, 1, 1, 3, 3,
- 1, 3, 1, 1, 1, 3, 3, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1
+ 1, 1, 2, 1, 1, 1, 1, 1, 1, 3,
+ 3, 1, 3, 1, 1, 1, 3, 3, 3, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1
} ;
-static yyconst flex_int16_t yy_base[46] =
+static yyconst flex_int16_t yy_base[54] =
{ 0,
- 0, 0, 62, 63, 59, 57, 55, 63, 63, 63,
- 19, 21, 23, 47, 63, 63, 37, 33, 28, 52,
- 50, 48, 63, 26, 0, 63, 31, 24, 32, 0,
- 63, 29, 22, 24, 19, 23, 19, 63, 23, 20,
- 22, 63, 63, 36, 35
+ 0, 0, 74, 75, 71, 69, 67, 75, 75, 75,
+ 22, 13, 25, 27, 58, 75, 75, 46, 42, 37,
+ 64, 62, 60, 75, 30, 44, 43, 0, 75, 38,
+ 31, 40, 24, 23, 0, 75, 31, 24, 75, 22,
+ 25, 20, 75, 24, 20, 75, 24, 21, 24, 75,
+ 75, 56, 40
} ;
-static yyconst flex_int16_t yy_def[46] =
+static yyconst flex_int16_t yy_def[54] =
{ 0,
- 43, 1, 43, 43, 43, 43, 44, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 44, 43, 43, 45, 43, 43, 43, 43, 45,
- 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 0, 43, 43
+ 51, 1, 51, 51, 51, 51, 52, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 52, 51, 51, 51, 51, 53, 51, 51,
+ 51, 51, 51, 51, 53, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 0, 51, 51
} ;
-static yyconst flex_int16_t yy_nxt[91] =
+static yyconst flex_int16_t yy_nxt[107] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 4, 4, 15, 16, 17, 4, 4, 4, 4,
- 4, 18, 4, 4, 19, 4, 4, 24, 24, 24,
- 24, 24, 24, 25, 24, 24, 22, 30, 22, 42,
- 41, 40, 39, 38, 37, 36, 35, 34, 33, 32,
- 31, 23, 21, 20, 29, 28, 27, 26, 23, 21,
- 20, 43, 3, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 43, 43, 43
+ 14, 15, 4, 4, 16, 17, 18, 4, 4, 4,
+ 4, 4, 4, 4, 19, 4, 4, 20, 4, 4,
+ 4, 25, 25, 26, 25, 25, 25, 25, 28, 25,
+ 25, 27, 35, 50, 49, 48, 47, 46, 45, 44,
+ 43, 42, 41, 40, 39, 28, 23, 38, 23, 37,
+ 36, 34, 33, 24, 22, 21, 32, 31, 30, 29,
+ 24, 22, 21, 51, 3, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+
+ 51, 51, 51, 51, 51, 51
} ;
-static yyconst flex_int16_t yy_chk[91] =
+static yyconst flex_int16_t yy_chk[107] =
{ 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, 11, 11, 12,
- 12, 13, 13, 12, 24, 24, 44, 45, 44, 41,
- 40, 39, 37, 36, 35, 34, 33, 32, 29, 28,
- 27, 22, 21, 20, 19, 18, 17, 14, 7, 6,
- 5, 3, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 43, 43, 43
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 11, 11, 12, 13, 13, 14, 14, 13, 25,
+ 25, 12, 53, 49, 48, 47, 45, 44, 42, 41,
+ 40, 38, 37, 34, 33, 13, 52, 32, 52, 31,
+ 30, 27, 26, 23, 22, 21, 20, 19, 18, 15,
+ 7, 6, 5, 3, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+
+ 51, 51, 51, 51, 51, 51
} ;
/* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[17] =
+static yyconst flex_int32_t yy_rule_can_match_eol[19] =
{ 0,
-0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
+0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
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 yyconst flex_int16_t yy_rule_linenum[16] =
+static yyconst flex_int16_t yy_rule_linenum[18] =
{ 0,
83, 87, 93, 103, 109, 123, 124, 125, 126, 127,
- 128, 129, 130, 131, 133
+ 128, 129, 130, 131, 132, 133, 135
} ;
/* The intent behind this definition is that it'll catch
// by moving it ahead by yyleng bytes. yyleng specifies the length of the
// currently matched token.
#define YY_USER_ACTION loc.columns(yyleng);
-#line 655 "lexer.cc"
+#line 656 "lexer.cc"
#define INITIAL 0
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#define ECHO fwrite( yytext, yyleng, 1, yyout )
/* %endif */
/* %if-c++-only C++ definition */
/* %endif */
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ yy_size_t n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
register char *yy_cp, *yy_bp;
register int yy_act;
+/* %% [7.0] user's declarations go here */
+#line 76 "lexer.ll"
+
+
+
+ // Code run each time yylex is called.
+ loc.step();
+
+
+#line 904 "lexer.cc"
+
if ( !(yy_init) )
{
(yy_init) = 1;
yy_load_buffer_state( );
}
- {
-/* %% [7.0] user's declarations go here */
-#line 76 "lexer.ll"
-
-
-
- // Code run each time yylex is called.
- loc.step();
-
-
-#line 938 "lexer.cc"
-
while ( 1 ) /* loops until end-of-file is reached */
{
/* %% [8.0] yymore()-related code goes here */
yy_match:
do
{
- register 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)];
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
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 >= 44 )
+ if ( yy_current_state >= 52 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_current_state != 43 );
+ while ( yy_current_state != 51 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
{
if ( yy_act == 0 )
fprintf( stderr, "--scanner backing up\n" );
- else if ( yy_act < 16 )
+ else if ( yy_act < 18 )
fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
(long)yy_rule_linenum[yy_act], yytext );
- else if ( yy_act == 16 )
+ else if ( yy_act == 18 )
fprintf( stderr, "--accepting default rule (\"%s\")\n",
yytext );
- else if ( yy_act == 17 )
+ else if ( yy_act == 19 )
fprintf( stderr, "--(end of buffer or a NUL)\n" );
else
fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
case 8:
YY_RULE_SETUP
#line 125 "lexer.ll"
-return isc::eval::EvalParser::make_SUBSTRING(loc);
+return isc::eval::EvalParser::make_DOTTEXT(loc);
YY_BREAK
case 9:
YY_RULE_SETUP
#line 126 "lexer.ll"
-return isc::eval::EvalParser::make_ALL(loc);
+return isc::eval::EvalParser::make_DOTHEX(loc);
YY_BREAK
case 10:
YY_RULE_SETUP
#line 127 "lexer.ll"
-return isc::eval::EvalParser::make_LPAREN(loc);
+return isc::eval::EvalParser::make_SUBSTRING(loc);
YY_BREAK
case 11:
YY_RULE_SETUP
#line 128 "lexer.ll"
-return isc::eval::EvalParser::make_RPAREN(loc);
+return isc::eval::EvalParser::make_ALL(loc);
YY_BREAK
case 12:
YY_RULE_SETUP
#line 129 "lexer.ll"
-return isc::eval::EvalParser::make_LBRACKET(loc);
+return isc::eval::EvalParser::make_LPAREN(loc);
YY_BREAK
case 13:
YY_RULE_SETUP
#line 130 "lexer.ll"
-return isc::eval::EvalParser::make_RBRACKET(loc);
+return isc::eval::EvalParser::make_RPAREN(loc);
YY_BREAK
case 14:
YY_RULE_SETUP
#line 131 "lexer.ll"
-return isc::eval::EvalParser::make_COMA(loc);
+return isc::eval::EvalParser::make_LBRACKET(loc);
YY_BREAK
case 15:
YY_RULE_SETUP
+#line 132 "lexer.ll"
+return isc::eval::EvalParser::make_RBRACKET(loc);
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
#line 133 "lexer.ll"
+return isc::eval::EvalParser::make_COMA(loc);
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 135 "lexer.ll"
driver.error (loc, "Invalid character: " + std::string(yytext));
YY_BREAK
case YY_STATE_EOF(INITIAL):
-#line 134 "lexer.ll"
+#line 136 "lexer.ll"
return isc::eval::EvalParser::make_END(loc);
YY_BREAK
-case 16:
+case 18:
YY_RULE_SETUP
-#line 135 "lexer.ll"
+#line 137 "lexer.ll"
ECHO;
YY_BREAK
-#line 1140 "lexer.cc"
+#line 1150 "lexer.cc"
case YY_END_OF_BUFFER:
{
"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 */
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
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 >= 44 )
+ if ( yy_current_state >= 52 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
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 >= 44 )
+ if ( yy_current_state >= 52 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 43);
+ yy_is_jam = (yy_current_state == 51);
- return yy_is_jam ? 0 : yy_current_state;
+ return yy_is_jam ? 0 : yy_current_state;
}
/* %if-c-only */
case EOB_ACT_END_OF_FILE:
{
if ( yywrap( ) )
- return EOF;
+ return 0;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
yyfree((void *) b );
}
+/* %if-c-only */
+
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+
+/* %endif */
+
+/* %if-c++-only */
+/* %endif */
+
/* 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 */
/** 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.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
{
YY_BUFFER_STATE b;
char *buf;
- yy_size_t n;
- yy_size_t i;
+ yy_size_t n, i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
/* %ok-for-header */
-#line 135 "lexer.ll"
+#line 137 "lexer.ll"
#line 39 "parser.yy" // lalr1.cc:413
# include "eval_context.h"
+#line 66 "parser.yy" // lalr1.cc:413
+
+namespace {
+
+/* Convert option code specified as string to an 16 bit unsigned
+ representation. If the option code is not within the range of
+ 0..65535 an error is reported. */
+uint16_t
+convert_option_code(const std::string& option_code,
+ const isc::eval::EvalParser::location_type& loc,
+ EvalContext& ctx) {
+ int n = 0;
+ try {
+ n = boost::lexical_cast<int>(option_code);
+ } catch (const boost::bad_lexical_cast &) {
+ // This can't happen...
+ ctx.error(loc, "Option code has invalid value in " + option_code);
+ }
+ if (n < 0 || n > 65535) {
+ ctx.error(loc, "Option code has invalid value in "
+ + option_code + ". Allowed range: 0..65535");
+ }
+ return (static_cast<uint16_t>(n));
+}
+}
-#line 57 "parser.cc" // lalr1.cc:413
+
+#line 83 "parser.cc" // lalr1.cc:413
#ifndef YY_
#line 21 "parser.yy" // lalr1.cc:479
namespace isc { namespace eval {
-#line 143 "parser.cc" // lalr1.cc:479
+#line 169 "parser.cc" // lalr1.cc:479
/* Return YYSTR after stripping away unnecessary quotes and
backslashes, so that it's suitable for yyerror. The heuristic is
{
switch (that.type_get ())
{
- case 12: // "constant string"
- case 13: // "integer"
- case 14: // "constant hexstring"
- case 15: // TOKEN
+ case 14: // "constant string"
+ case 15: // "integer"
+ case 16: // "constant hexstring"
+ case 17: // TOKEN
value.move< std::string > (that.value);
break;
state = that.state;
switch (that.type_get ())
{
- case 12: // "constant string"
- case 13: // "integer"
- case 14: // "constant hexstring"
- case 15: // TOKEN
+ case 14: // "constant string"
+ case 15: // "integer"
+ case 16: // "constant hexstring"
+ case 17: // TOKEN
value.copy< std::string > (that.value);
break;
<< yysym.location << ": ";
switch (yytype)
{
- case 12: // "constant string"
+ case 14: // "constant string"
-#line 61 "parser.yy" // lalr1.cc:636
+#line 63 "parser.yy" // lalr1.cc:636
{ yyoutput << yysym.value.template as< std::string > (); }
-#line 324 "parser.cc" // lalr1.cc:636
+#line 350 "parser.cc" // lalr1.cc:636
break;
- case 13: // "integer"
+ case 15: // "integer"
-#line 61 "parser.yy" // lalr1.cc:636
+#line 63 "parser.yy" // lalr1.cc:636
{ yyoutput << yysym.value.template as< std::string > (); }
-#line 331 "parser.cc" // lalr1.cc:636
+#line 357 "parser.cc" // lalr1.cc:636
break;
- case 14: // "constant hexstring"
+ case 16: // "constant hexstring"
-#line 61 "parser.yy" // lalr1.cc:636
+#line 63 "parser.yy" // lalr1.cc:636
{ yyoutput << yysym.value.template as< std::string > (); }
-#line 338 "parser.cc" // lalr1.cc:636
+#line 364 "parser.cc" // lalr1.cc:636
break;
- case 15: // TOKEN
+ case 17: // TOKEN
-#line 61 "parser.yy" // lalr1.cc:636
+#line 63 "parser.yy" // lalr1.cc:636
{ yyoutput << yysym.value.template as< std::string > (); }
-#line 345 "parser.cc" // lalr1.cc:636
+#line 371 "parser.cc" // lalr1.cc:636
break;
when using variants. */
switch (yyr1_[yyn])
{
- case 12: // "constant string"
- case 13: // "integer"
- case 14: // "constant hexstring"
- case 15: // TOKEN
+ case 14: // "constant string"
+ case 15: // "integer"
+ case 16: // "constant hexstring"
+ case 17: // TOKEN
yylhs.value.build< std::string > ();
break;
switch (yyn)
{
case 3:
-#line 73 "parser.yy" // lalr1.cc:859
+#line 104 "parser.yy" // lalr1.cc:859
{
TokenPtr eq(new TokenEqual());
ctx.expression.push_back(eq);
}
-#line 575 "parser.cc" // lalr1.cc:859
+#line 601 "parser.cc" // lalr1.cc:859
break;
case 4:
-#line 80 "parser.yy" // lalr1.cc:859
+#line 111 "parser.yy" // lalr1.cc:859
{
TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ()));
ctx.expression.push_back(str);
}
-#line 584 "parser.cc" // lalr1.cc:859
+#line 610 "parser.cc" // lalr1.cc:859
break;
case 5:
-#line 85 "parser.yy" // lalr1.cc:859
+#line 116 "parser.yy" // lalr1.cc:859
{
TokenPtr hex(new TokenHexString(yystack_[0].value.as< std::string > ()));
ctx.expression.push_back(hex);
}
-#line 593 "parser.cc" // lalr1.cc:859
+#line 619 "parser.cc" // lalr1.cc:859
break;
case 6:
-#line 90 "parser.yy" // lalr1.cc:859
+#line 121 "parser.yy" // lalr1.cc:859
{
- int n = 0;
- try {
- n = boost::lexical_cast<int>(yystack_[1].value.as< std::string > ());
- } catch (const boost::bad_lexical_cast &) {
- // This can't happen...
- ctx.error(yystack_[1].location,
- "Option code has invalid value in " + yystack_[1].value.as< std::string > ());
- }
- if (n < 0 || n > 65535) {
- ctx.error(yystack_[1].location,
- "Option code has invalid value in "
- + yystack_[1].value.as< std::string > () + ". Allowed range: 0..65535");
- }
- TokenPtr opt(new TokenOption(static_cast<uint16_t>(n)));
+ uint16_t numeric_code = convert_option_code(yystack_[2].value.as< std::string > (), yystack_[2].location, ctx);
+ TokenPtr opt(new TokenOption(numeric_code, TokenOption::TEXTUAL));
ctx.expression.push_back(opt);
}
-#line 615 "parser.cc" // lalr1.cc:859
+#line 629 "parser.cc" // lalr1.cc:859
break;
case 7:
-#line 108 "parser.yy" // lalr1.cc:859
+#line 127 "parser.yy" // lalr1.cc:859
+ {
+ uint16_t numeric_code = convert_option_code(yystack_[2].value.as< std::string > (), yystack_[2].location, ctx);
+ TokenPtr opt(new TokenOption(numeric_code, TokenOption::HEXADECIMAL));
+ ctx.expression.push_back(opt);
+ }
+#line 639 "parser.cc" // lalr1.cc:859
+ break;
+
+ case 8:
+#line 133 "parser.yy" // lalr1.cc:859
{
TokenPtr sub(new TokenSubstring());
ctx.expression.push_back(sub);
}
-#line 624 "parser.cc" // lalr1.cc:859
+#line 648 "parser.cc" // lalr1.cc:859
break;
- case 9:
-#line 117 "parser.yy" // lalr1.cc:859
+ case 10:
+#line 142 "parser.yy" // lalr1.cc:859
{
TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ()));
ctx.expression.push_back(str);
}
-#line 633 "parser.cc" // lalr1.cc:859
+#line 657 "parser.cc" // lalr1.cc:859
break;
- case 10:
-#line 124 "parser.yy" // lalr1.cc:859
+ case 11:
+#line 149 "parser.yy" // lalr1.cc:859
{
TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ()));
ctx.expression.push_back(str);
}
-#line 642 "parser.cc" // lalr1.cc:859
+#line 666 "parser.cc" // lalr1.cc:859
break;
- case 11:
-#line 129 "parser.yy" // lalr1.cc:859
+ case 12:
+#line 154 "parser.yy" // lalr1.cc:859
{
TokenPtr str(new TokenString("all"));
ctx.expression.push_back(str);
}
-#line 651 "parser.cc" // lalr1.cc:859
+#line 675 "parser.cc" // lalr1.cc:859
break;
-#line 655 "parser.cc" // lalr1.cc:859
+#line 679 "parser.cc" // lalr1.cc:859
default:
break;
}
const signed char
EvalParser::yypact_[] =
{
- -4, -7, -2, -9, -9, -9, 7, -9, 6, 0,
- -4, -9, -4, 3, 8, -9, -9, 4, -9, 9,
- -1, -9, -9, 10, -9
+ -4, -8, -2, -9, -9, -9, 11, -9, 12, -1,
+ -4, -9, -4, 3, 8, -9, 0, 4, -9, -9,
+ -9, 9, -6, -9, -9, 10, -9
};
const unsigned char
EvalParser::yydefact_[] =
{
- 0, 0, 0, 4, 5, 8, 0, 2, 0, 0,
- 0, 1, 0, 0, 0, 3, 6, 0, 9, 0,
- 0, 11, 10, 0, 7
+ 0, 0, 0, 4, 5, 9, 0, 2, 0, 0,
+ 0, 1, 0, 0, 0, 3, 0, 0, 6, 7,
+ 10, 0, 0, 12, 11, 0, 8
};
const signed char
EvalParser::yypgoto_[] =
{
- -9, -9, -9, -8, -9, -9
+ -9, -9, -9, -7, -9, -9
};
const signed char
EvalParser::yydefgoto_[] =
{
- -1, 6, 7, 8, 19, 23
+ -1, 6, 7, 8, 21, 25
};
const unsigned char
EvalParser::yytable_[] =
{
- 1, 2, 14, 9, 15, 21, 10, 11, 3, 12,
- 4, 5, 22, 13, 16, 17, 20, 18, 0, 24
+ 1, 2, 23, 14, 9, 15, 18, 19, 10, 24,
+ 3, 11, 4, 5, 13, 12, 16, 17, 22, 20,
+ 0, 26
};
const signed char
EvalParser::yycheck_[] =
{
- 4, 5, 10, 10, 12, 6, 8, 0, 12, 3,
- 14, 15, 13, 13, 11, 7, 7, 13, -1, 9
+ 4, 5, 8, 10, 12, 12, 6, 7, 10, 15,
+ 14, 0, 16, 17, 15, 3, 13, 9, 9, 15,
+ -1, 11
};
const unsigned char
EvalParser::yystos_[] =
{
- 0, 4, 5, 12, 14, 15, 17, 18, 19, 10,
- 8, 0, 3, 13, 19, 19, 11, 7, 13, 20,
- 7, 6, 13, 21, 9
+ 0, 4, 5, 14, 16, 17, 19, 20, 21, 12,
+ 10, 0, 3, 15, 21, 21, 13, 9, 6, 7,
+ 15, 22, 9, 8, 15, 23, 11
};
const unsigned char
EvalParser::yyr1_[] =
{
- 0, 16, 17, 18, 19, 19, 19, 19, 19, 20,
- 21, 21
+ 0, 18, 19, 20, 21, 21, 21, 21, 21, 21,
+ 22, 23, 23
};
const unsigned char
EvalParser::yyr2_[] =
{
- 0, 2, 1, 3, 1, 1, 4, 8, 1, 1,
- 1, 1
+ 0, 2, 1, 3, 1, 1, 5, 5, 8, 1,
+ 1, 1, 1
};
const EvalParser::yytname_[] =
{
"\"end of file\"", "error", "$undefined", "\"==\"", "\"option\"",
- "\"substring\"", "\"all\"", "\",\"", "\"(\"", "\")\"", "\"[\"", "\"]\"",
- "\"constant string\"", "\"integer\"", "\"constant hexstring\"", "TOKEN",
- "$accept", "expression", "bool_expr", "string_expr", "start_expr",
- "length_expr", YY_NULLPTR
+ "\"substring\"", "\".text\"", "\".hex\"", "\"all\"", "\",\"", "\"(\"",
+ "\")\"", "\"[\"", "\"]\"", "\"constant string\"", "\"integer\"",
+ "\"constant hexstring\"", "TOKEN", "$accept", "expression", "bool_expr",
+ "string_expr", "start_expr", "length_expr", YY_NULLPTR
};
#if YYDEBUG
const unsigned char
EvalParser::yyrline_[] =
{
- 0, 69, 69, 72, 79, 84, 89, 107, 112, 116,
- 123, 128
+ 0, 100, 100, 103, 110, 115, 120, 126, 132, 137,
+ 141, 148, 153
};
// Print the state stack on the debug stream.
#line 21 "parser.yy" // lalr1.cc:1167
} } // isc::eval
-#line 1032 "parser.cc" // lalr1.cc:1167
-#line 135 "parser.yy" // lalr1.cc:1168
+#line 1058 "parser.cc" // lalr1.cc:1167
+#line 160 "parser.yy" // lalr1.cc:1168
void
isc::eval::EvalParser::error(const location_type& loc,