Parcourir la source

[4088fd] Regenerated flex/bison

Francis Dupont il y a 9 ans
Parent
commit
e9cca43872
3 fichiers modifiés avec 191 ajouts et 140 suppressions
  1. 100 86
      src/lib/eval/lexer.cc
  2. 62 42
      src/lib/eval/parser.cc
  3. 29 12
      src/lib/eval/parser.h

+ 100 - 86
src/lib/eval/lexer.cc

@@ -469,8 +469,8 @@ static void yy_fatal_error (yyconst char msg[]  );
 	(yy_c_buf_p) = yy_cp;
 	(yy_c_buf_p) = yy_cp;
 
 
 /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
 /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
-#define YY_NUM_RULES 11
-#define YY_END_OF_BUFFER 12
+#define YY_NUM_RULES 12
+#define YY_END_OF_BUFFER 13
 /* This struct is not used in this scanner,
 /* This struct is not used in this scanner,
    but its presence is necessary. */
    but its presence is necessary. */
 struct yy_trans_info
 struct yy_trans_info
@@ -478,12 +478,12 @@ struct yy_trans_info
 	flex_int32_t yy_verify;
 	flex_int32_t yy_verify;
 	flex_int32_t yy_nxt;
 	flex_int32_t yy_nxt;
 	};
 	};
-static yyconst flex_int16_t yy_accept[36] =
+static yyconst flex_int16_t yy_accept[39] =
     {   0,
     {   0,
-        0,    0,   12,   10,    1,    2,   10,    7,    8,    9,
-       10,   10,   10,    1,    2,    3,    0,    5,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    4,    6,    0
+        0,    0,   13,   11,    1,    2,   11,    8,    9,   10,
+       11,   11,   11,   11,    1,    2,    3,    0,    0,    6,
+        0,    0,    4,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    5,    7,    0
     } ;
     } ;
 
 
 static yyconst flex_int32_t yy_ec[256] =
 static yyconst flex_int32_t yy_ec[256] =
@@ -492,16 +492,16 @@ 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,    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,
         1,    2,    1,    1,    1,    1,    1,    1,    4,    5,
-        6,    1,    1,    7,    1,    1,    1,    8,    8,    8,
-        8,    8,    8,    8,    8,    8,    8,    1,    1,    1,
-        9,    1,    1,    1,   10,   10,   10,   10,   10,   10,
-       10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
-       10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
-       11,    1,   12,    1,   10,    1,   10,   13,   10,   10,
-
-       10,   10,   14,   10,   15,   10,   10,   10,   10,   16,
-       17,   18,   10,   19,   20,   21,   22,   10,   10,   10,
-       10,   10,    1,    1,    1,    1,    1,    1,    1,    1,
+        6,    1,    1,    7,    1,    1,    1,    8,    9,    9,
+        9,    9,    9,    9,    9,    9,    9,    1,    1,    1,
+       10,    1,    1,    1,   11,   11,   11,   11,   11,   11,
+       12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,   12,   13,   12,   12,
+       14,    1,   15,    1,   12,    1,   11,   16,   11,   11,
+
+       11,   11,   17,   12,   18,   12,   12,   12,   12,   19,
+       20,   21,   12,   22,   23,   24,   25,   12,   12,   13,
+       12,   12,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -518,57 +518,61 @@ static yyconst flex_int32_t yy_ec[256] =
         1,    1,    1,    1,    1
         1,    1,    1,    1,    1
     } ;
     } ;
 
 
-static yyconst flex_int32_t yy_meta[23] =
+static yyconst flex_int32_t yy_meta[26] =
     {   0,
     {   0,
-        1,    1,    1,    2,    1,    1,    1,    2,    1,    2,
-        1,    1,    2,    2,    2,    2,    2,    2,    2,    2,
-        2,    2
+        1,    1,    1,    2,    1,    1,    1,    3,    3,    1,
+        3,    2,    2,    1,    1,    3,    2,    2,    2,    2,
+        2,    2,    2,    2,    2
     } ;
     } ;
 
 
-static yyconst flex_int16_t yy_base[37] =
+static yyconst flex_int16_t yy_base[42] =
     {   0,
     {   0,
-        0,    0,   48,   49,   45,   43,   41,   49,   49,   49,
-       35,   25,   20,   39,   37,   49,   35,   49,   17,   24,
-       21,   15,   17,   12,   16,   12,   19,   14,   20,   10,
-       15,   11,   49,   49,   49,   22
+        0,   22,   58,   59,   55,   53,   51,   59,   59,   59,
+       41,   43,   31,   26,   42,   40,   59,   37,    0,   59,
+       16,   23,    0,   20,   14,   16,   11,   15,   11,   17,
+        4,    3,    0,    6,    0,   59,   59,   59,   45,   47,
+        6
     } ;
     } ;
 
 
-static yyconst flex_int16_t yy_def[37] =
+static yyconst flex_int16_t yy_def[42] =
     {   0,
     {   0,
-       35,    1,   35,   35,   35,   35,   36,   35,   35,   35,
-       35,   35,   35,   35,   35,   35,   36,   35,   35,   35,
-       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
-       35,   35,   35,   35,    0,   35
+       39,   39,   38,   38,   38,   38,   40,   38,   38,   38,
+       38,   38,   38,   38,   38,   38,   38,   40,   41,   38,
+       38,   38,   41,   38,   38,   38,   38,   38,   38,   38,
+       38,   38,   38,   38,   38,   38,   38,    0,   38,   38,
+       38
     } ;
     } ;
 
 
-static yyconst flex_int16_t yy_nxt[72] =
+static yyconst flex_int16_t yy_nxt[85] =
     {   0,
     {   0,
-        4,    5,    6,    7,    8,    9,   10,    4,   11,    4,
-        4,    4,    4,    4,    4,    4,   12,    4,    4,   13,
-        4,    4,   31,   17,   34,   32,   33,   31,   30,   29,
-       28,   27,   26,   25,   24,   23,   22,   21,   16,   15,
-       14,   20,   19,   18,   16,   15,   14,   35,    3,   35,
-       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
-       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
-       35
+       38,    5,    6,    7,    8,    9,   10,   11,   23,   12,
+       34,   34,   38,   34,   34,   38,   37,   38,   35,   13,
+       36,   33,   14,    5,    6,    7,    8,    9,   10,   11,
+       32,   12,   31,   30,   29,   28,   27,   26,   25,   24,
+       17,   13,   16,   15,   14,    4,    4,    4,   18,   18,
+       22,   21,   20,   19,   17,   16,   15,   38,    3,   38,
+       38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
+       38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
+       38,   38,   38,   38
     } ;
     } ;
 
 
-static yyconst flex_int16_t yy_chk[72] =
+static yyconst flex_int16_t yy_chk[85] =
     {   0,
     {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,   31,   36,   32,   30,   31,   29,   28,   27,
-       26,   25,   24,   23,   22,   21,   20,   19,   17,   15,
-       14,   13,   12,   11,    7,    6,    5,    3,   35,   35,
-       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
-       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
-       35
+        0,    1,    1,    1,    1,    1,    1,    1,   41,    1,
+       32,   32,    0,   34,   34,    0,   35,    0,   33,    1,
+       34,   31,    1,    2,    2,    2,    2,    2,    2,    2,
+       30,    2,   29,   28,   27,   26,   25,   24,   22,   21,
+       18,    2,   16,   15,    2,   39,   39,   39,   40,   40,
+       14,   13,   12,   11,    7,    6,    5,    3,   38,   38,
+       38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
+       38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
+       38,   38,   38,   38
     } ;
     } ;
 
 
 /* Table of booleans, true if rule could match eol. */
 /* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[12] =
+static yyconst flex_int32_t yy_rule_can_match_eol[13] =
     {   0,
     {   0,
-0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,     };
+0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     };
 
 
 static yy_state_type yy_last_accepting_state;
 static yy_state_type yy_last_accepting_state;
 static char *yy_last_accepting_cpos;
 static char *yy_last_accepting_cpos;
@@ -576,9 +580,10 @@ static char *yy_last_accepting_cpos;
 extern int yy_flex_debug;
 extern int yy_flex_debug;
 int yy_flex_debug = 1;
 int yy_flex_debug = 1;
 
 
-static yyconst flex_int16_t yy_rule_linenum[11] =
+static yyconst flex_int16_t yy_rule_linenum[12] =
     {   0,
     {   0,
-       83,   87,   93,  103,  154,  155,  156,  157,  158,  160
+       84,   88,   94,  104,  110,  161,  162,  163,  164,  165,
+      167
     } ;
     } ;
 
 
 /* The intent behind this definition is that it'll catch
 /* The intent behind this definition is that it'll catch
@@ -640,12 +645,12 @@ static isc::eval::location loc;
    useful in more complex cases. */
    useful in more complex cases. */
 /* These are not token expressions yet, just convenience expressions that
 /* These are not token expressions yet, just convenience expressions that
    can be used during actual token definitions. */
    can be used during actual token definitions. */
-#line 70 "lexer.ll"
+#line 71 "lexer.ll"
 // This code run each time a pattern is matched. It updates the location
 // 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 yyleng bytes. yyleng specifies the length of the
 // currently matched token.
 // currently matched token.
 #define YY_USER_ACTION  loc.columns(yyleng);
 #define YY_USER_ACTION  loc.columns(yyleng);
-#line 649 "lexer.cc"
+#line 654 "lexer.cc"
 
 
 #define INITIAL 0
 #define INITIAL 0
 
 
@@ -920,7 +925,7 @@ YY_DECL
 
 
 	{
 	{
 /* %% [7.0] user's declarations go here */
 /* %% [7.0] user's declarations go here */
-#line 76 "lexer.ll"
+#line 77 "lexer.ll"
 
 
 
 
 
 
@@ -928,7 +933,7 @@ YY_DECL
     loc.step();
     loc.step();
 
 
 
 
-#line 932 "lexer.cc"
+#line 937 "lexer.cc"
 
 
 	while ( 1 )		/* loops until end-of-file is reached */
 	while ( 1 )		/* loops until end-of-file is reached */
 		{
 		{
@@ -957,13 +962,13 @@ yy_match:
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != 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];
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 36 )
+				if ( yy_current_state >= 39 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
 				}
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 			++yy_cp;
 			++yy_cp;
 			}
 			}
-		while ( yy_current_state != 35 );
+		while ( yy_current_state != 38 );
 		yy_cp = (yy_last_accepting_cpos);
 		yy_cp = (yy_last_accepting_cpos);
 		yy_current_state = (yy_last_accepting_state);
 		yy_current_state = (yy_last_accepting_state);
 
 
@@ -992,13 +997,13 @@ do_action:	/* This label is used only to access EOF actions. */
 			{
 			{
 			if ( yy_act == 0 )
 			if ( yy_act == 0 )
 				fprintf( stderr, "--scanner backing up\n" );
 				fprintf( stderr, "--scanner backing up\n" );
-			else if ( yy_act < 11 )
+			else if ( yy_act < 12 )
 				fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
 				fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
 				         (long)yy_rule_linenum[yy_act], yytext );
 				         (long)yy_rule_linenum[yy_act], yytext );
-			else if ( yy_act == 11 )
+			else if ( yy_act == 12 )
 				fprintf( stderr, "--accepting default rule (\"%s\")\n",
 				fprintf( stderr, "--accepting default rule (\"%s\")\n",
 				         yytext );
 				         yytext );
-			else if ( yy_act == 12 )
+			else if ( yy_act == 13 )
 				fprintf( stderr, "--(end of buffer or a NUL)\n" );
 				fprintf( stderr, "--(end of buffer or a NUL)\n" );
 			else
 			else
 				fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
 				fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
@@ -1016,7 +1021,7 @@ do_action:	/* This label is used only to access EOF actions. */
 
 
 case 1:
 case 1:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 83 "lexer.ll"
+#line 84 "lexer.ll"
 {
 {
     // Ok, we found a with space. Let's ignore it and update loc variable.
     // Ok, we found a with space. Let's ignore it and update loc variable.
     loc.step();
     loc.step();
@@ -1025,7 +1030,7 @@ YY_RULE_SETUP
 case 2:
 case 2:
 /* rule 2 can match eol */
 /* rule 2 can match eol */
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 87 "lexer.ll"
+#line 88 "lexer.ll"
 {
 {
     // Newline found. Let's update the location and continue.
     // Newline found. Let's update the location and continue.
     loc.lines(yyleng);
     loc.lines(yyleng);
@@ -1034,7 +1039,7 @@ YY_RULE_SETUP
 	YY_BREAK
 	YY_BREAK
 case 3:
 case 3:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 93 "lexer.ll"
+#line 94 "lexer.ll"
 {
 {
     // A string has been matched. It contains the actual string and single quotes.
     // 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.
     // We need to get those quotes out of the way and just use its content, e.g.
@@ -1047,7 +1052,16 @@ YY_RULE_SETUP
 	YY_BREAK
 	YY_BREAK
 case 4:
 case 4:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 103 "lexer.ll"
+#line 104 "lexer.ll"
+{
+    // A hex string has been matched. It contains the '0x' or '0X' header
+    // followed by at least one hexadecimal digit.
+    return isc::eval::EvalParser::make_HEXSTRING(yytext, loc);
+}
+	YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 110 "lexer.ll"
 {
 {
     // option[123] token found. Let's see if the numeric value can be
     // option[123] token found. Let's see if the numeric value can be
     // converted to integer and if it has a reasonable value.
     // converted to integer and if it has a reasonable value.
@@ -1099,46 +1113,46 @@ YY_RULE_SETUP
     return isc::eval::EvalParser::make_OPTION(n, loc);
     return isc::eval::EvalParser::make_OPTION(n, loc);
 }
 }
 	YY_BREAK
 	YY_BREAK
-case 5:
+case 6:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 154 "lexer.ll"
+#line 161 "lexer.ll"
 return isc::eval::EvalParser::make_EQUAL(loc);
 return isc::eval::EvalParser::make_EQUAL(loc);
 	YY_BREAK
 	YY_BREAK
-case 6:
+case 7:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 155 "lexer.ll"
+#line 162 "lexer.ll"
 return isc::eval::EvalParser::make_SUBSTRING(loc);
 return isc::eval::EvalParser::make_SUBSTRING(loc);
 	YY_BREAK
 	YY_BREAK
-case 7:
+case 8:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 156 "lexer.ll"
+#line 163 "lexer.ll"
 return isc::eval::EvalParser::make_LPAREN(loc);
 return isc::eval::EvalParser::make_LPAREN(loc);
 	YY_BREAK
 	YY_BREAK
-case 8:
+case 9:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 157 "lexer.ll"
+#line 164 "lexer.ll"
 return isc::eval::EvalParser::make_RPAREN(loc);
 return isc::eval::EvalParser::make_RPAREN(loc);
 	YY_BREAK
 	YY_BREAK
-case 9:
+case 10:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 158 "lexer.ll"
+#line 165 "lexer.ll"
 return isc::eval::EvalParser::make_COMA(loc);
 return isc::eval::EvalParser::make_COMA(loc);
 	YY_BREAK
 	YY_BREAK
-case 10:
+case 11:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 160 "lexer.ll"
+#line 167 "lexer.ll"
 driver.error (loc, "Invalid character: " + std::string(yytext));
 driver.error (loc, "Invalid character: " + std::string(yytext));
 	YY_BREAK
 	YY_BREAK
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(INITIAL):
-#line 161 "lexer.ll"
+#line 168 "lexer.ll"
 return isc::eval::EvalParser::make_END(loc);
 return isc::eval::EvalParser::make_END(loc);
 	YY_BREAK
 	YY_BREAK
-case 11:
+case 12:
 YY_RULE_SETUP
 YY_RULE_SETUP
-#line 162 "lexer.ll"
+#line 169 "lexer.ll"
 ECHO;
 ECHO;
 	YY_BREAK
 	YY_BREAK
-#line 1142 "lexer.cc"
+#line 1156 "lexer.cc"
 
 
 	case YY_END_OF_BUFFER:
 	case YY_END_OF_BUFFER:
 		{
 		{
@@ -1451,7 +1465,7 @@ static int yy_get_next_buffer (void)
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != 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];
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 36 )
+			if ( yy_current_state >= 39 )
 				yy_c = yy_meta[(unsigned int) yy_c];
 				yy_c = yy_meta[(unsigned int) yy_c];
 			}
 			}
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1484,11 +1498,11 @@ static int yy_get_next_buffer (void)
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != 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];
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 36 )
+		if ( yy_current_state >= 39 )
 			yy_c = yy_meta[(unsigned int) yy_c];
 			yy_c = yy_meta[(unsigned int) yy_c];
 		}
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 35);
+	yy_is_jam = (yy_current_state == 38);
 
 
 		return yy_is_jam ? 0 : yy_current_state;
 		return yy_is_jam ? 0 : yy_current_state;
 }
 }
@@ -2226,7 +2240,7 @@ void yyfree (void * ptr )
 
 
 /* %ok-for-header */
 /* %ok-for-header */
 
 
-#line 162 "lexer.ll"
+#line 169 "lexer.ll"
 
 
 
 
 
 

+ 62 - 42
src/lib/eval/parser.cc

@@ -251,11 +251,12 @@ namespace isc { namespace eval {
   {
   {
       switch (that.type_get ())
       switch (that.type_get ())
     {
     {
-      case 9: // "option code"
+      case 10: // "option code"
         value.move< int > (that.value);
         value.move< int > (that.value);
         break;
         break;
 
 
       case 8: // "constant string"
       case 8: // "constant string"
+      case 9: // "constant hexstring"
         value.move< std::string > (that.value);
         value.move< std::string > (that.value);
         break;
         break;
 
 
@@ -274,11 +275,12 @@ namespace isc { namespace eval {
     state = that.state;
     state = that.state;
       switch (that.type_get ())
       switch (that.type_get ())
     {
     {
-      case 9: // "option code"
+      case 10: // "option code"
         value.copy< int > (that.value);
         value.copy< int > (that.value);
         break;
         break;
 
 
       case 8: // "constant string"
       case 8: // "constant string"
+      case 9: // "constant hexstring"
         value.copy< std::string > (that.value);
         value.copy< std::string > (that.value);
         break;
         break;
 
 
@@ -320,16 +322,23 @@ namespace isc { namespace eval {
     {
     {
             case 8: // "constant string"
             case 8: // "constant string"
 
 
-#line 57 "parser.yy" // lalr1.cc:636
+#line 58 "parser.yy" // lalr1.cc:636
         { yyoutput << yysym.value.template as< std::string > (); }
         { yyoutput << yysym.value.template as< std::string > (); }
-#line 326 "parser.cc" // lalr1.cc:636
+#line 328 "parser.cc" // lalr1.cc:636
         break;
         break;
 
 
-      case 9: // "option code"
+      case 9: // "constant hexstring"
 
 
-#line 57 "parser.yy" // lalr1.cc:636
+#line 58 "parser.yy" // lalr1.cc:636
+        { yyoutput << yysym.value.template as< std::string > (); }
+#line 335 "parser.cc" // lalr1.cc:636
+        break;
+
+      case 10: // "option code"
+
+#line 58 "parser.yy" // lalr1.cc:636
         { yyoutput << yysym.value.template as< int > (); }
         { yyoutput << yysym.value.template as< int > (); }
-#line 333 "parser.cc" // lalr1.cc:636
+#line 342 "parser.cc" // lalr1.cc:636
         break;
         break;
 
 
 
 
@@ -448,7 +457,7 @@ namespace isc { namespace eval {
   yyla.location.begin.filename = yyla.location.end.filename = &ctx.file;
   yyla.location.begin.filename = yyla.location.end.filename = &ctx.file;
 }
 }
 
 
-#line 452 "parser.cc" // lalr1.cc:745
+#line 461 "parser.cc" // lalr1.cc:745
 
 
     /* Initialize the stack.  The initial state will be set in
     /* Initialize the stack.  The initial state will be set in
        yynewstate, since the latter expects the semantical and the
        yynewstate, since the latter expects the semantical and the
@@ -538,11 +547,12 @@ namespace isc { namespace eval {
          when using variants.  */
          when using variants.  */
         switch (yyr1_[yyn])
         switch (yyr1_[yyn])
     {
     {
-      case 9: // "option code"
+      case 10: // "option code"
         yylhs.value.build< int > ();
         yylhs.value.build< int > ();
         break;
         break;
 
 
       case 8: // "constant string"
       case 8: // "constant string"
+      case 9: // "constant hexstring"
         yylhs.value.build< std::string > ();
         yylhs.value.build< std::string > ();
         break;
         break;
 
 
@@ -564,42 +574,51 @@ namespace isc { namespace eval {
           switch (yyn)
           switch (yyn)
             {
             {
   case 2:
   case 2:
-#line 65 "parser.yy" // lalr1.cc:859
+#line 67 "parser.yy" // lalr1.cc:859
     {
     {
     TokenPtr eq(new TokenEqual());
     TokenPtr eq(new TokenEqual());
     ctx.expression.push_back(eq);
     ctx.expression.push_back(eq);
-}
-#line 573 "parser.cc" // lalr1.cc:859
+  }
+#line 583 "parser.cc" // lalr1.cc:859
     break;
     break;
 
 
   case 4:
   case 4:
-#line 72 "parser.yy" // lalr1.cc:859
+#line 75 "parser.yy" // lalr1.cc:859
     {
     {
     TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ()));
     TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ()));
     ctx.expression.push_back(str);
     ctx.expression.push_back(str);
-}
-#line 582 "parser.cc" // lalr1.cc:859
+  }
+#line 592 "parser.cc" // lalr1.cc:859
     break;
     break;
 
 
   case 5:
   case 5:
-#line 76 "parser.yy" // lalr1.cc:859
+#line 79 "parser.yy" // lalr1.cc:859
+    {
+    TokenPtr hex(new TokenHexString(yystack_[0].value.as< std::string > ()));
+    ctx.expression.push_back(hex);
+  }
+#line 601 "parser.cc" // lalr1.cc:859
+    break;
+
+  case 6:
+#line 83 "parser.yy" // lalr1.cc:859
     {
     {
     TokenPtr opt(new TokenOption(yystack_[0].value.as< int > ()));
     TokenPtr opt(new TokenOption(yystack_[0].value.as< int > ()));
     ctx.expression.push_back(opt);
     ctx.expression.push_back(opt);
-}
-#line 591 "parser.cc" // lalr1.cc:859
+  }
+#line 610 "parser.cc" // lalr1.cc:859
     break;
     break;
 
 
-  case 6:
-#line 80 "parser.yy" // lalr1.cc:859
+  case 7:
+#line 87 "parser.yy" // lalr1.cc:859
     {
     {
     /* push back TokenSubstring */
     /* push back TokenSubstring */
   }
   }
-#line 599 "parser.cc" // lalr1.cc:859
+#line 618 "parser.cc" // lalr1.cc:859
     break;
     break;
 
 
 
 
-#line 603 "parser.cc" // lalr1.cc:859
+#line 622 "parser.cc" // lalr1.cc:859
             default:
             default:
               break;
               break;
             }
             }
@@ -854,67 +873,67 @@ namespace isc { namespace eval {
   }
   }
 
 
 
 
-  const signed char EvalParser::yypact_ninf_ = -7;
+  const signed char EvalParser::yypact_ninf_ = -8;
 
 
   const signed char EvalParser::yytable_ninf_ = -1;
   const signed char EvalParser::yytable_ninf_ = -1;
 
 
   const signed char
   const signed char
   EvalParser::yypact_[] =
   EvalParser::yypact_[] =
   {
   {
-       0,    -5,    -7,    -7,     3,     7,     0,    -7,     0,     1,
-      -7,     0,     6,     0,     5,    -7
+       0,    -5,    -8,    -8,    -8,     3,     8,     0,    -8,     0,
+       1,    -8,     0,     7,     0,     6,    -8
   };
   };
 
 
   const unsigned char
   const unsigned char
   EvalParser::yydefact_[] =
   EvalParser::yydefact_[] =
   {
   {
-       0,     0,     4,     5,     0,     3,     0,     1,     0,     0,
-       2,     0,     0,     0,     0,     6
+       0,     0,     4,     5,     6,     0,     3,     0,     1,     0,
+       0,     2,     0,     0,     0,     0,     7
   };
   };
 
 
   const signed char
   const signed char
   EvalParser::yypgoto_[] =
   EvalParser::yypgoto_[] =
   {
   {
-      -7,    -7,    -6
+      -8,    -8,    -7
   };
   };
 
 
   const signed char
   const signed char
   EvalParser::yydefgoto_[] =
   EvalParser::yydefgoto_[] =
   {
   {
-      -1,     4,     5
+      -1,     5,     6
   };
   };
 
 
   const unsigned char
   const unsigned char
   EvalParser::yytable_[] =
   EvalParser::yytable_[] =
   {
   {
-       9,     6,    10,     7,     1,    12,    11,    14,     2,     3,
-       8,    13,    15
+      10,     7,    11,     8,     1,    13,    12,    15,     2,     3,
+       4,     9,    14,    16
   };
   };
 
 
   const unsigned char
   const unsigned char
   EvalParser::yycheck_[] =
   EvalParser::yycheck_[] =
   {
   {
-       6,     6,     8,     0,     4,    11,     5,    13,     8,     9,
-       3,     5,     7
+       7,     6,     9,     0,     4,    12,     5,    14,     8,     9,
+      10,     3,     5,     7
   };
   };
 
 
   const unsigned char
   const unsigned char
   EvalParser::yystos_[] =
   EvalParser::yystos_[] =
   {
   {
-       0,     4,     8,     9,    11,    12,     6,     0,     3,    12,
-      12,     5,    12,     5,    12,     7
+       0,     4,     8,     9,    10,    12,    13,     6,     0,     3,
+      13,    13,     5,    13,     5,    13,     7
   };
   };
 
 
   const unsigned char
   const unsigned char
   EvalParser::yyr1_[] =
   EvalParser::yyr1_[] =
   {
   {
-       0,    10,    11,    11,    12,    12,    12
+       0,    11,    12,    12,    13,    13,    13,    13
   };
   };
 
 
   const unsigned char
   const unsigned char
   EvalParser::yyr2_[] =
   EvalParser::yyr2_[] =
   {
   {
-       0,     2,     3,     1,     1,     1,     8
+       0,     2,     3,     1,     1,     1,     1,     8
   };
   };
 
 
 
 
@@ -925,15 +944,16 @@ namespace isc { namespace eval {
   const EvalParser::yytname_[] =
   const EvalParser::yytname_[] =
   {
   {
   "\"end of file\"", "error", "$undefined", "\"==\"", "\"substring\"",
   "\"end of file\"", "error", "$undefined", "\"==\"", "\"substring\"",
-  "\",\"", "\"(\"", "\")\"", "\"constant string\"", "\"option code\"",
-  "$accept", "expression", "token", YY_NULLPTR
+  "\",\"", "\"(\"", "\")\"", "\"constant string\"",
+  "\"constant hexstring\"", "\"option code\"", "$accept", "expression",
+  "token", YY_NULLPTR
   };
   };
 
 
 #if YYDEBUG
 #if YYDEBUG
   const unsigned char
   const unsigned char
   EvalParser::yyrline_[] =
   EvalParser::yyrline_[] =
   {
   {
-       0,    65,    65,    69,    72,    76,    80
+       0,    67,    67,    71,    75,    79,    83,    87
   };
   };
 
 
   // Print the state stack on the debug stream.
   // Print the state stack on the debug stream.
@@ -968,8 +988,8 @@ namespace isc { namespace eval {
 
 
 #line 21 "parser.yy" // lalr1.cc:1167
 #line 21 "parser.yy" // lalr1.cc:1167
 } } // isc::eval
 } } // isc::eval
-#line 972 "parser.cc" // lalr1.cc:1167
-#line 84 "parser.yy" // lalr1.cc:1168
+#line 992 "parser.cc" // lalr1.cc:1167
+#line 92 "parser.yy" // lalr1.cc:1168
 
 
 void
 void
 isc::eval::EvalParser::error(const location_type& l,
 isc::eval::EvalParser::error(const location_type& l,

+ 29 - 12
src/lib/eval/parser.h

@@ -297,6 +297,7 @@ namespace isc { namespace eval {
       char dummy1[sizeof(int)];
       char dummy1[sizeof(int)];
 
 
       // "constant string"
       // "constant string"
+      // "constant hexstring"
       char dummy2[sizeof(std::string)];
       char dummy2[sizeof(std::string)];
 };
 };
 
 
@@ -327,7 +328,8 @@ namespace isc { namespace eval {
         TOKEN_LPAREN = 261,
         TOKEN_LPAREN = 261,
         TOKEN_RPAREN = 262,
         TOKEN_RPAREN = 262,
         TOKEN_STRING = 263,
         TOKEN_STRING = 263,
-        TOKEN_OPTION = 264
+        TOKEN_HEXSTRING = 264,
+        TOKEN_OPTION = 265
       };
       };
     };
     };
 
 
@@ -466,6 +468,10 @@ namespace isc { namespace eval {
 
 
     static inline
     static inline
     symbol_type
     symbol_type
+    make_HEXSTRING (const std::string& v, const location_type& l);
+
+    static inline
+    symbol_type
     make_OPTION (const int& v, const location_type& l);
     make_OPTION (const int& v, const location_type& l);
 
 
 
 
@@ -673,12 +679,12 @@ namespace isc { namespace eval {
     enum
     enum
     {
     {
       yyeof_ = 0,
       yyeof_ = 0,
-      yylast_ = 12,     ///< Last index in yytable_.
+      yylast_ = 13,     ///< Last index in yytable_.
       yynnts_ = 3,  ///< Number of nonterminal symbols.
       yynnts_ = 3,  ///< Number of nonterminal symbols.
-      yyfinal_ = 7, ///< Termination state number.
+      yyfinal_ = 8, ///< Termination state number.
       yyterror_ = 1,
       yyterror_ = 1,
       yyerrcode_ = 256,
       yyerrcode_ = 256,
-      yyntokens_ = 10  ///< Number of tokens.
+      yyntokens_ = 11  ///< Number of tokens.
     };
     };
 
 
 
 
@@ -721,9 +727,9 @@ namespace isc { namespace eval {
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
-       5,     6,     7,     8,     9
+       5,     6,     7,     8,     9,    10
     };
     };
-    const unsigned int user_token_number_max_ = 264;
+    const unsigned int user_token_number_max_ = 265;
     const token_number_type undef_token_ = 2;
     const token_number_type undef_token_ = 2;
 
 
     if (static_cast<int>(t) <= yyeof_)
     if (static_cast<int>(t) <= yyeof_)
@@ -756,11 +762,12 @@ namespace isc { namespace eval {
   {
   {
       switch (other.type_get ())
       switch (other.type_get ())
     {
     {
-      case 9: // "option code"
+      case 10: // "option code"
         value.copy< int > (other.value);
         value.copy< int > (other.value);
         break;
         break;
 
 
       case 8: // "constant string"
       case 8: // "constant string"
+      case 9: // "constant hexstring"
         value.copy< std::string > (other.value);
         value.copy< std::string > (other.value);
         break;
         break;
 
 
@@ -781,11 +788,12 @@ namespace isc { namespace eval {
     (void) v;
     (void) v;
       switch (this->type_get ())
       switch (this->type_get ())
     {
     {
-      case 9: // "option code"
+      case 10: // "option code"
         value.copy< int > (v);
         value.copy< int > (v);
         break;
         break;
 
 
       case 8: // "constant string"
       case 8: // "constant string"
+      case 9: // "constant hexstring"
         value.copy< std::string > (v);
         value.copy< std::string > (v);
         break;
         break;
 
 
@@ -844,11 +852,12 @@ namespace isc { namespace eval {
     // Type destructor.
     // Type destructor.
     switch (yytype)
     switch (yytype)
     {
     {
-      case 9: // "option code"
+      case 10: // "option code"
         value.template destroy< int > ();
         value.template destroy< int > ();
         break;
         break;
 
 
       case 8: // "constant string"
       case 8: // "constant string"
+      case 9: // "constant hexstring"
         value.template destroy< std::string > ();
         value.template destroy< std::string > ();
         break;
         break;
 
 
@@ -875,11 +884,12 @@ namespace isc { namespace eval {
     super_type::move(s);
     super_type::move(s);
       switch (this->type_get ())
       switch (this->type_get ())
     {
     {
-      case 9: // "option code"
+      case 10: // "option code"
         value.move< int > (s.value);
         value.move< int > (s.value);
         break;
         break;
 
 
       case 8: // "constant string"
       case 8: // "constant string"
+      case 9: // "constant hexstring"
         value.move< std::string > (s.value);
         value.move< std::string > (s.value);
         break;
         break;
 
 
@@ -938,7 +948,8 @@ namespace isc { namespace eval {
     const unsigned short int
     const unsigned short int
     yytoken_number_[] =
     yytoken_number_[] =
     {
     {
-       0,   256,   257,   258,   259,   260,   261,   262,   263,   264
+       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
+     265
     };
     };
     return static_cast<token_type> (yytoken_number_[type]);
     return static_cast<token_type> (yytoken_number_[type]);
   }
   }
@@ -986,6 +997,12 @@ namespace isc { namespace eval {
   }
   }
 
 
   EvalParser::symbol_type
   EvalParser::symbol_type
+  EvalParser::make_HEXSTRING (const std::string& v, const location_type& l)
+  {
+    return symbol_type (token::TOKEN_HEXSTRING, v, l);
+  }
+
+  EvalParser::symbol_type
   EvalParser::make_OPTION (const int& v, const location_type& l)
   EvalParser::make_OPTION (const int& v, const location_type& l)
   {
   {
     return symbol_type (token::TOKEN_OPTION, v, l);
     return symbol_type (token::TOKEN_OPTION, v, l);
@@ -994,7 +1011,7 @@ namespace isc { namespace eval {
 
 
 #line 21 "parser.yy" // lalr1.cc:392
 #line 21 "parser.yy" // lalr1.cc:392
 } } // isc::eval
 } } // isc::eval
-#line 998 "parser.h" // lalr1.cc:392
+#line 1015 "parser.h" // lalr1.cc:392