diff options
author | Francis Dupont <fdupont@isc.org> | 2018-09-16 12:42:24 +0200 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2018-09-16 12:42:24 +0200 |
commit | 8f87a57b3f8cac88e84ef4e9288e9788406f64b4 (patch) | |
tree | 5ac19e56db02f304d588c42720db460e67ba0023 /src/lib/eval | |
parent | [67-expressions-hexa-strings] checkpoint to update syntax (diff) | |
download | kea-8f87a57b3f8cac88e84ef4e9288e9788406f64b4.tar.xz kea-8f87a57b3f8cac88e84ef4e9288e9788406f64b4.zip |
[67-expressions-hexa-strings] regen flex/bison
Diffstat (limited to 'src/lib/eval')
-rw-r--r-- | src/lib/eval/lexer.cc | 332 | ||||
-rw-r--r-- | src/lib/eval/location.hh | 32 | ||||
-rw-r--r-- | src/lib/eval/parser.cc | 868 | ||||
-rw-r--r-- | src/lib/eval/parser.h | 209 | ||||
-rw-r--r-- | src/lib/eval/position.hh | 32 | ||||
-rw-r--r-- | src/lib/eval/stack.hh | 42 |
6 files changed, 788 insertions, 727 deletions
diff --git a/src/lib/eval/lexer.cc b/src/lib/eval/lexer.cc index 48c177a6d9..7e66c7d797 100644 --- a/src/lib/eval/lexer.cc +++ b/src/lib/eval/lexer.cc @@ -710,8 +710,8 @@ static void yynoreturn yy_fatal_error ( const char* msg ); /* %% [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 53 -#define YY_END_OF_BUFFER 54 +#define YY_NUM_RULES 54 +#define YY_END_OF_BUFFER 55 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -719,42 +719,44 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_acclist[291] = +static const flex_int16_t yy_acclist[298] = { 0, - 54, 52, 53, 1, 52, 53, 2, 53, 52, 53, - 46, 52, 53, 47, 52, 53, 51, 52, 53, 50, - 52, 53, 52, 53, 45, 52, 53, 5, 52, 53, - 5, 52, 53, 52, 53, 52, 53, 52, 53,16390, - 52, 53,16390, 48, 52, 53, 49, 52, 53, 52, - 53,16390, 52, 53,16390, 52, 53,16390, 52, 53, - 16390, 52, 53,16390, 52, 53,16390, 52, 53,16390, - 52, 53,16390, 52, 53,16390, 52, 53,16390, 52, - 53,16390, 52, 53,16390, 52, 53,16390, 52, 53, - 16390, 52, 53,16390, 52, 53,16390, 52, 53,16390, + 55, 53, 54, 1, 53, 54, 2, 54, 53, 54, + 47, 53, 54, 48, 53, 54, 52, 53, 54, 51, + 53, 54, 53, 54, 46, 53, 54, 5, 53, 54, + 5, 53, 54, 53, 54, 53, 54, 53, 54,16390, + 53, 54,16390, 49, 53, 54, 50, 53, 54, 53, + 54,16390, 53, 54,16390, 53, 54,16390, 53, 54, + 16390, 53, 54,16390, 53, 54,16390, 53, 54,16390, + 53, 54,16390, 53, 54,16390, 53, 54,16390, 53, + 54,16390, 53, 54,16390, 53, 54,16390, 53, 54, + 16390, 53, 54,16390, 53, 54,16390, 53, 54,16390, 1, 2, 3, 5, 5, 7, 8,16390,16390, 8198, 16390,16390,16390,16390,16390,16390,16390,16390,16390,16390, 16390,16390,16390,16390,16390,16390,16390,16390,16390,16390, - 43,16390,16390,16390,16390,16390,16390,16390,16390,16390, - 16390,16390, 4, 7, 38,16390, 42,16390,16390,16390, + 44,16390,16390,16390,16390,16390,16390,16390,16390,16390, + 16390,16390, 4, 7, 38,16390, 43,16390,16390,16390, 16390, 20,16390,16390,16390,16390, 15,16390,16390,16390, - 16390,16390, 21,16390,16390, 23,16390,16390,16390, 41, + 16390,16390, 21,16390,16390, 23,16390,16390,16390, 42, 16390,16390,16390, 17,16390,16390,16390, 19,16390,16390, 16390,16390,16390,16390,16390,16390, 35,16390,16390,16390, - 16390, 24,16390,16390,16390,16390,16390,16390,16390,16390, - - 16390, 22,16390, 30,16390,16390,16390,16390, 14,16390, - 16390,16390,16390,16390,16390,16390,16390,16390, 25,16390, - 18,16390,16390,16390,16390,16390,16390,16390,16390,16390, - 16390,16390,16390,16390, 26,16390, 39,16390,16390, 16, - 16390, 27,16390, 40,16390,16390, 44,16390,16390, 9, - 16390,16390, 10,16390, 11,16390, 29,16390,16390,16390, - 33,16390, 28,16390, 7,16390,16390, 31,16390,16390, - 16390, 32,16390,16390, 13,16390, 12,16390,16390,16390, - 16390, 37,16390,16390, 36,16390,16390,16390, 34,16390 + 16390,16390, 24,16390,16390,16390,16390,16390,16390,16390, + + 16390,16390, 22,16390, 30,16390,16390,16390,16390, 14, + 16390,16390,16390,16390,16390,16390,16390,16390,16390,16390, + 25,16390, 18,16390,16390,16390,16390,16390,16390,16390, + 16390,16390,16390,16390,16390,16390, 26,16390, 39,16390, + 16390, 16,16390, 27,16390,16390, 40,16390,16390, 45, + 16390,16390, 9,16390,16390, 10,16390, 11,16390, 29, + 16390,16390,16390, 33,16390, 28,16390, 7,16390,16390, + 16390, 31,16390,16390,16390, 32,16390,16390,16390, 13, + 16390, 12,16390,16390,16390,16390, 41,16390, 37,16390, + 16390, 36,16390,16390,16390, 34,16390 + } ; -static const flex_int16_t yy_accept[208] = +static const flex_int16_t yy_accept[214] = { 0, 1, 1, 1, 2, 4, 7, 9, 11, 14, 17, 20, 23, 25, 28, 31, 34, 36, 38, 41, 44, @@ -769,16 +771,17 @@ static const flex_int16_t yy_accept[208] = 159, 160, 161, 162, 163, 165, 166, 168, 169, 170, 172, 173, 174, 176, 177, 178, 180, 181, 182, 183, - 184, 185, 185, 186, 187, 189, 190, 191, 192, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 204, 206, - 207, 208, 209, 211, 212, 213, 214, 214, 215, 216, - 217, 218, 219, 221, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 235, 237, 239, - 240, 242, 244, 246, 247, 249, 250, 252, 253, 255, - 257, 259, 260, 261, 263, 265, 266, 267, 268, 270, - 271, 272, 274, 274, 275, 277, 279, 280, 281, 282, - - 284, 285, 287, 288, 289, 291, 291 + 184, 185, 185, 186, 187, 189, 190, 191, 192, 193, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 205, + 207, 208, 209, 210, 212, 213, 214, 215, 215, 216, + 217, 218, 219, 220, 221, 223, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 237, + 239, 241, 242, 244, 246, 247, 249, 250, 252, 253, + 255, 256, 258, 260, 262, 263, 264, 266, 268, 269, + 270, 271, 272, 274, 275, 276, 278, 278, 279, 280, + + 282, 284, 285, 286, 287, 289, 291, 292, 294, 295, + 296, 298, 298 } ; static const YY_CHAR yy_ec[256] = @@ -822,107 +825,107 @@ static const YY_CHAR yy_meta[45] = 1, 1, 1, 1 } ; -static const flex_int16_t yy_base[212] = +static const flex_int16_t yy_base[218] = { 0, - 0, 0, 319, 320, 316, 314, 312, 320, 320, 320, - 320, 34, 320, 39, 36, 300, 298, 81, 115, 320, - 320, 24, 37, 37, 26, 282, 45, 284, 43, 48, - 275, 43, 59, 283, 106, 50, 282, 277, 305, 303, - 301, 320, 122, 137, 112, 289, 288, 0, 287, 0, - 320, 143, 150, 0, 0, 320, 268, 274, 276, 263, - 257, 256, 255, 263, 270, 249, 264, 246, 74, 254, - 253, 262, 252, 256, 244, 243, 0, 255, 241, 247, - 256, 253, 253, 233, 252, 239, 250, 146, 0, 0, - 0, 0, 246, 246, 247, 0, 242, 229, 241, 0, - - 231, 228, 239, 230, 0, 230, 0, 237, 220, 0, - 228, 220, 148, 234, 230, 0, 216, 214, 218, 226, - 225, 154, 224, 226, 0, 210, 207, 220, 0, 218, - 217, 204, 219, 214, 196, 203, 215, 0, 0, 193, - 210, 195, 0, 195, 197, 206, 162, 193, 190, 192, - 189, 189, 0, 0, 199, 199, 186, 186, 187, 195, - 156, 172, 169, 175, 167, 165, 166, 0, 0, 164, - 0, 0, 0, 175, 0, 173, 0, 173, 0, 0, - 0, 167, 171, 187, 0, 170, 164, 156, 0, 155, - 157, 0, 183, 152, 0, 0, 161, 156, 161, 0, - - 164, 0, 124, 115, 0, 320, 208, 210, 212, 85, - 215 + 0, 0, 325, 326, 322, 320, 318, 326, 326, 326, + 326, 34, 326, 39, 36, 306, 304, 81, 115, 326, + 326, 24, 37, 37, 26, 288, 45, 290, 43, 48, + 281, 43, 59, 289, 106, 50, 288, 283, 311, 309, + 307, 326, 122, 137, 112, 295, 294, 0, 293, 0, + 326, 143, 150, 0, 0, 326, 274, 280, 282, 269, + 263, 262, 261, 269, 276, 255, 270, 252, 74, 260, + 259, 268, 258, 262, 250, 249, 0, 261, 247, 253, + 262, 259, 259, 239, 258, 245, 256, 146, 0, 0, + 0, 0, 252, 252, 253, 0, 248, 235, 247, 233, + + 236, 233, 244, 235, 0, 235, 0, 242, 225, 0, + 233, 225, 148, 239, 235, 0, 221, 219, 223, 231, + 230, 154, 229, 231, 0, 215, 212, 225, 210, 0, + 222, 221, 208, 223, 218, 200, 207, 219, 0, 0, + 197, 214, 199, 0, 199, 201, 210, 162, 197, 194, + 196, 193, 193, 192, 0, 0, 202, 202, 189, 189, + 190, 198, 156, 185, 184, 190, 172, 169, 166, 0, + 0, 168, 0, 0, 174, 0, 177, 0, 175, 0, + 175, 0, 0, 0, 169, 173, 189, 0, 170, 166, + 161, 157, 0, 156, 158, 0, 183, 153, 162, 0, + + 0, 161, 156, 161, 0, 0, 164, 0, 124, 115, + 0, 326, 208, 210, 212, 85, 215 } ; -static const flex_int16_t yy_def[212] = +static const flex_int16_t yy_def[218] = { 0, - 206, 1, 206, 206, 206, 206, 207, 206, 206, 206, - 206, 206, 206, 206, 14, 208, 206, 206, 18, 206, - 206, 18, 18, 18, 18, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 206, 206, - 207, 206, 206, 206, 14, 208, 209, 210, 208, 211, - 206, 206, 19, 18, 19, 206, 19, 19, 19, 19, + 212, 1, 212, 212, 212, 212, 213, 212, 212, 212, + 212, 212, 212, 212, 14, 214, 212, 212, 18, 212, + 212, 18, 18, 18, 18, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 212, 212, + 213, 212, 212, 212, 14, 214, 215, 216, 214, 217, + 212, 212, 19, 18, 19, 212, 19, 19, 19, 19, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 206, 210, 211, + 19, 19, 19, 19, 19, 19, 19, 212, 216, 217, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 206, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 212, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 206, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 212, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 206, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 212, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 206, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 212, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 0, 206, 206, 206, 206, - 206 + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 0, 212, 212, 212, 212, 212 } ; -static const flex_int16_t yy_nxt[365] = +static const flex_int16_t yy_nxt[371] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 16, 17, 18, 19, 19, 20, 21, 4, 22, 18, 23, 24, 25, 18, 26, 27, 28, 19, 29, 30, 31, 32, 33, 34, 35, 36, 19, 37, 19, 38, 43, 43, 43, 43, 44, 45, - 45, 45, 45, 46, 206, 47, 57, 48, 58, 61, + 45, 45, 45, 46, 212, 47, 57, 48, 58, 61, 63, 47, 47, 47, 47, 47, 47, 59, 64, 70, - 72, 66, 60, 71, 73, 62, 84, 67, 206, 76, + 72, 66, 60, 71, 73, 62, 84, 67, 212, 76, 77, 48, 52, 52, 68, 78, 74, 85, 89, 53, 79, 54, 54, 54, 54, 46, 103, 54, 55, 55, 104, 56, 53, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 206, - 206, 55, 43, 43, 43, 43, 81, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 212, + 212, 55, 43, 43, 43, 43, 81, 55, 55, 55, 55, 55, 55, 82, 52, 52, 83, 88, 88, 88, - 88, 206, 206, 205, 206, 122, 88, 88, 88, 88, - 138, 139, 204, 56, 147, 147, 147, 147, 179, 180, - 206, 167, 147, 147, 147, 147, 186, 186, 186, 186, - 186, 186, 186, 186, 206, 206, 203, 202, 201, 200, - 199, 197, 196, 195, 194, 193, 192, 191, 190, 189, + 88, 212, 212, 211, 212, 122, 88, 88, 88, 88, + 139, 140, 210, 56, 148, 148, 148, 148, 182, 183, + 212, 169, 148, 148, 148, 148, 189, 189, 189, 189, + 189, 189, 189, 189, 212, 212, 209, 208, 207, 206, + 205, 204, 202, 201, 200, 199, 198, 197, 196, 195, - 188, 187, 185, 206, 184, 183, 182, 198, 41, 181, + 194, 193, 192, 212, 191, 190, 188, 203, 41, 187, 41, 41, 41, 49, 49, 47, 47, 90, 90, 90, - 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, - 168, 166, 165, 164, 163, 162, 161, 160, 159, 158, - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, - 146, 145, 144, 143, 142, 141, 140, 137, 136, 135, - 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, - 124, 123, 121, 120, 119, 118, 117, 116, 115, 114, - 113, 112, 111, 110, 109, 108, 107, 106, 105, 102, - 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, - - 91, 50, 46, 50, 42, 40, 39, 87, 86, 80, - 75, 69, 65, 51, 50, 42, 40, 39, 206, 3, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206 + 186, 185, 184, 181, 180, 179, 178, 177, 176, 175, + 174, 173, 172, 171, 170, 168, 167, 166, 165, 164, + 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, + 153, 152, 151, 150, 149, 147, 146, 145, 144, 143, + 142, 141, 138, 137, 136, 135, 134, 133, 132, 131, + 130, 129, 128, 127, 126, 125, 124, 123, 121, 120, + 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, + 109, 108, 107, 106, 105, 102, 101, 100, 99, 98, + + 97, 96, 95, 94, 93, 92, 91, 50, 46, 50, + 42, 40, 39, 87, 86, 80, 75, 69, 65, 51, + 50, 42, 40, 39, 212, 3, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212 } ; -static const flex_int16_t yy_chk[365] = +static const flex_int16_t yy_chk[371] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -932,7 +935,7 @@ static const flex_int16_t yy_chk[365] = 14, 14, 14, 14, 15, 14, 22, 14, 22, 24, 25, 14, 14, 14, 14, 14, 14, 23, 25, 29, 30, 27, 23, 29, 30, 24, 36, 27, 15, 32, - 32, 14, 18, 18, 27, 33, 30, 36, 210, 18, + 32, 14, 18, 18, 27, 33, 30, 36, 216, 18, 33, 18, 18, 18, 18, 18, 69, 18, 18, 18, 69, 18, 18, 18, 18, 18, 18, 18, 18, 18, @@ -940,50 +943,50 @@ static const flex_int16_t yy_chk[365] = 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 45, 19, 43, 43, 43, 43, 35, 19, 19, 19, 19, 19, 19, 35, 52, 52, 35, 44, 44, 44, - 44, 53, 53, 204, 45, 88, 88, 88, 88, 88, - 113, 113, 203, 52, 122, 122, 122, 122, 161, 161, - 53, 147, 147, 147, 147, 147, 167, 167, 167, 167, - 186, 186, 186, 186, 193, 193, 201, 199, 198, 197, - 194, 191, 190, 188, 187, 184, 183, 182, 178, 176, - - 174, 170, 166, 193, 165, 164, 163, 193, 207, 162, - 207, 207, 207, 208, 208, 209, 209, 211, 211, 211, - 160, 159, 158, 157, 156, 155, 152, 151, 150, 149, - 148, 146, 145, 144, 142, 141, 140, 137, 136, 135, - 134, 133, 132, 131, 130, 128, 127, 126, 124, 123, - 121, 120, 119, 118, 117, 115, 114, 112, 111, 109, - 108, 106, 104, 103, 102, 101, 99, 98, 97, 95, - 94, 93, 87, 86, 85, 84, 83, 82, 81, 80, - 79, 78, 76, 75, 74, 73, 72, 71, 70, 68, - 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, - - 57, 49, 47, 46, 41, 40, 39, 38, 37, 34, - 31, 28, 26, 17, 16, 7, 6, 5, 3, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206 + 44, 53, 53, 210, 45, 88, 88, 88, 88, 88, + 113, 113, 209, 52, 122, 122, 122, 122, 163, 163, + 53, 148, 148, 148, 148, 148, 169, 169, 169, 169, + 189, 189, 189, 189, 197, 197, 207, 204, 203, 202, + 199, 198, 195, 194, 192, 191, 190, 187, 186, 185, + + 181, 179, 177, 197, 175, 172, 168, 197, 213, 167, + 213, 213, 213, 214, 214, 215, 215, 217, 217, 217, + 166, 165, 164, 162, 161, 160, 159, 158, 157, 154, + 153, 152, 151, 150, 149, 147, 146, 145, 143, 142, + 141, 138, 137, 136, 135, 134, 133, 132, 131, 129, + 128, 127, 126, 124, 123, 121, 120, 119, 118, 117, + 115, 114, 112, 111, 109, 108, 106, 104, 103, 102, + 101, 100, 99, 98, 97, 95, 94, 93, 87, 86, + 85, 84, 83, 82, 81, 80, 79, 78, 76, 75, + 74, 73, 72, 71, 70, 68, 67, 66, 65, 64, + + 63, 62, 61, 60, 59, 58, 57, 49, 47, 46, + 41, 40, 39, 38, 37, 34, 31, 28, 26, 17, + 16, 7, 6, 5, 3, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212 } ; /* Table of booleans, true if rule could match eol. */ -static const flex_int32_t yy_rule_can_match_eol[54] = +static const flex_int32_t yy_rule_can_match_eol[55] = { 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, - 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, }; extern int yy_flex_debug; int yy_flex_debug = 1; -static const flex_int16_t yy_rule_linenum[53] = +static const flex_int16_t yy_rule_linenum[54] = { 0, 106, 111, 117, 127, 133, 151, 158, 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, 208, 209, 210, 211, 212, 213, 214, - 215, 216 + 215, 216, 217 } ; static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; @@ -1049,7 +1052,7 @@ namespace { /* To avoid the call to exit... oops! */ #define YY_FATAL_ERROR(msg) isc::eval::EvalContext::fatal(msg) -#line 1052 "lexer.cc" +#line 1055 "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 @@ -1074,8 +1077,8 @@ namespace { by moving it ahead by yyleng bytes. yyleng specifies the length of the currently matched token. */ #define YY_USER_ACTION loc.columns(evalleng); -#line 1077 "lexer.cc" -#line 1078 "lexer.cc" +#line 1080 "lexer.cc" +#line 1081 "lexer.cc" #define INITIAL 0 @@ -1380,7 +1383,7 @@ YY_DECL -#line 1383 "lexer.cc" +#line 1386 "lexer.cc" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1408,14 +1411,14 @@ yy_match: 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 >= 207 ) + if ( yy_current_state >= 213 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } - while ( yy_current_state != 206 ); + while ( yy_current_state != 212 ); yy_find_action: /* %% [10.0] code to find the action number goes here */ @@ -1478,13 +1481,13 @@ do_action: /* This label is used only to access EOF actions. */ { if ( yy_act == 0 ) fprintf( stderr, "--scanner backing up\n" ); - else if ( yy_act < 53 ) + else if ( yy_act < 54 ) fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", (long)yy_rule_linenum[yy_act], yytext ); - else if ( yy_act == 53 ) + else if ( yy_act == 54 ) fprintf( stderr, "--accepting default rule (\"%s\")\n", yytext ); - else if ( yy_act == 54 ) + else if ( yy_act == 55 ) fprintf( stderr, "--(end of buffer or a NUL)\n" ); else fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); @@ -1750,73 +1753,78 @@ return isc::eval::EvalParser::make_IFELSE(loc); case 41: YY_RULE_SETUP #line 205 "lexer.ll" -return isc::eval::EvalParser::make_NOT(loc); +return isc::eval::EvalParser::make_TOHEXSTRING(loc); YY_BREAK case 42: YY_RULE_SETUP #line 206 "lexer.ll" -return isc::eval::EvalParser::make_AND(loc); +return isc::eval::EvalParser::make_NOT(loc); YY_BREAK case 43: YY_RULE_SETUP #line 207 "lexer.ll" -return isc::eval::EvalParser::make_OR(loc); +return isc::eval::EvalParser::make_AND(loc); YY_BREAK case 44: YY_RULE_SETUP #line 208 "lexer.ll" -return isc::eval::EvalParser::make_MEMBER(loc); +return isc::eval::EvalParser::make_OR(loc); YY_BREAK case 45: YY_RULE_SETUP #line 209 "lexer.ll" -return isc::eval::EvalParser::make_DOT(loc); +return isc::eval::EvalParser::make_MEMBER(loc); YY_BREAK case 46: YY_RULE_SETUP #line 210 "lexer.ll" -return isc::eval::EvalParser::make_LPAREN(loc); +return isc::eval::EvalParser::make_DOT(loc); YY_BREAK case 47: YY_RULE_SETUP #line 211 "lexer.ll" -return isc::eval::EvalParser::make_RPAREN(loc); +return isc::eval::EvalParser::make_LPAREN(loc); YY_BREAK case 48: YY_RULE_SETUP #line 212 "lexer.ll" -return isc::eval::EvalParser::make_LBRACKET(loc); +return isc::eval::EvalParser::make_RPAREN(loc); YY_BREAK case 49: YY_RULE_SETUP #line 213 "lexer.ll" -return isc::eval::EvalParser::make_RBRACKET(loc); +return isc::eval::EvalParser::make_LBRACKET(loc); YY_BREAK case 50: YY_RULE_SETUP #line 214 "lexer.ll" -return isc::eval::EvalParser::make_COMA(loc); +return isc::eval::EvalParser::make_RBRACKET(loc); YY_BREAK case 51: YY_RULE_SETUP #line 215 "lexer.ll" -return isc::eval::EvalParser::make_ANY(loc); +return isc::eval::EvalParser::make_COMA(loc); YY_BREAK case 52: YY_RULE_SETUP #line 216 "lexer.ll" +return isc::eval::EvalParser::make_ANY(loc); + YY_BREAK +case 53: +YY_RULE_SETUP +#line 217 "lexer.ll" driver.error (loc, "Invalid character: " + std::string(evaltext)); YY_BREAK case YY_STATE_EOF(INITIAL): -#line 217 "lexer.ll" +#line 218 "lexer.ll" return isc::eval::EvalParser::make_END(loc); YY_BREAK -case 53: +case 54: YY_RULE_SETUP -#line 218 "lexer.ll" +#line 219 "lexer.ll" ECHO; YY_BREAK -#line 1819 "lexer.cc" +#line 1827 "lexer.cc" case YY_END_OF_BUFFER: { @@ -2102,7 +2110,7 @@ static int yy_get_next_buffer (void) 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 >= 207 ) + if ( yy_current_state >= 213 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; @@ -2130,11 +2138,11 @@ static int yy_get_next_buffer (void) 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 >= 207 ) + if ( yy_current_state >= 213 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 206); + yy_is_jam = (yy_current_state == 212); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; @@ -2900,7 +2908,7 @@ void yyfree (void * ptr ) /* %ok-for-header */ -#line 218 "lexer.ll" +#line 219 "lexer.ll" using namespace isc::eval; diff --git a/src/lib/eval/location.hh b/src/lib/eval/location.hh index 291696d580..b20a76b1a8 100644 --- a/src/lib/eval/location.hh +++ b/src/lib/eval/location.hh @@ -1,8 +1,9 @@ -// A Bison parser, made by GNU Bison 3.0.4. +// Generated 201809161042 +// A Bison parser, made by GNU Bison 3.0.5. // Locations for Bison parsers in C++ -// Copyright (C) 2002-2015 Free Software Foundation, Inc. +// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -40,9 +41,9 @@ # include "position.hh" -#line 14 "parser.yy" // location.cc:296 +#line 14 "parser.yy" // location.cc:292 namespace isc { namespace eval { -#line 46 "location.hh" // location.cc:296 +#line 46 "location.hh" // location.cc:292 /// Abstract a location. class location { @@ -52,30 +53,27 @@ namespace isc { namespace eval { location (const position& b, const position& e) : begin (b) , end (e) - { - } + {} /// Construct a 0-width location in \a p. explicit location (const position& p = position ()) : begin (p) , end (p) - { - } + {} /// Construct a 0-width location in \a f, \a l, \a c. explicit location (std::string* f, - unsigned int l = 1u, - unsigned int c = 1u) + unsigned l = 1u, + unsigned c = 1u) : begin (f, l, c) , end (f, l, c) - { - } + {} /// Initialization. void initialize (std::string* f = YY_NULLPTR, - unsigned int l = 1u, - unsigned int c = 1u) + unsigned l = 1u, + unsigned c = 1u) { begin.initialize (f, l, c); end = begin; @@ -173,7 +171,7 @@ namespace isc { namespace eval { inline std::basic_ostream<YYChar>& operator<< (std::basic_ostream<YYChar>& ostr, const location& loc) { - unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0; + unsigned end_col = 0 < loc.end.column ? loc.end.column - 1 : 0; ostr << loc.begin; if (loc.end.filename && (!loc.begin.filename @@ -186,7 +184,7 @@ namespace isc { namespace eval { return ostr; } -#line 14 "parser.yy" // location.cc:296 +#line 14 "parser.yy" // location.cc:292 } } // isc::eval -#line 192 "location.hh" // location.cc:296 +#line 189 "location.hh" // location.cc:292 #endif // !YY_EVAL_LOCATION_HH_INCLUDED diff --git a/src/lib/eval/parser.cc b/src/lib/eval/parser.cc index 7f6290134a..86a9b2345f 100644 --- a/src/lib/eval/parser.cc +++ b/src/lib/eval/parser.cc @@ -1,8 +1,8 @@ -// A Bison parser, made by GNU Bison 3.0.4. +// A Bison parser, made by GNU Bison 3.0.5. // Skeleton implementation for Bison LALR(1) parsers in C++ -// Copyright (C) 2002-2015 Free Software Foundation, Inc. +// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ // First part of user declarations. -#line 39 "parser.cc" // lalr1.cc:404 +#line 39 "parser.cc" // lalr1.cc:406 # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -49,13 +49,13 @@ // User implementation prologue. -#line 53 "parser.cc" // lalr1.cc:412 +#line 53 "parser.cc" // lalr1.cc:414 // Unqualified %code blocks. -#line 33 "parser.yy" // lalr1.cc:413 +#line 33 "parser.yy" // lalr1.cc:415 # include "eval_context.h" -#line 59 "parser.cc" // lalr1.cc:413 +#line 59 "parser.cc" // lalr1.cc:415 #ifndef YY_ @@ -106,7 +106,7 @@ { \ *yycdebug_ << Title << ' '; \ yy_print_ (*yycdebug_, Symbol); \ - *yycdebug_ << std::endl; \ + *yycdebug_ << '\n'; \ } \ } while (false) @@ -125,9 +125,9 @@ #else // !EVALDEBUG # define YYCDEBUG if (false) std::cerr -# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol) -# define YY_REDUCE_PRINT(Rule) static_cast<void>(0) -# define YY_STACK_PRINT() static_cast<void>(0) +# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast<void> (0) +# define YY_STACK_PRINT() static_cast<void> (0) #endif // !EVALDEBUG @@ -139,9 +139,9 @@ #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus_) -#line 14 "parser.yy" // lalr1.cc:479 +#line 14 "parser.yy" // lalr1.cc:481 namespace isc { namespace eval { -#line 145 "parser.cc" // lalr1.cc:479 +#line 145 "parser.cc" // lalr1.cc:481 /* Return YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is @@ -202,24 +202,20 @@ namespace isc { namespace eval { // by_state. - inline EvalParser::by_state::by_state () : state (empty_state) {} - inline EvalParser::by_state::by_state (const by_state& other) : state (other.state) {} - inline void EvalParser::by_state::clear () { state = empty_state; } - inline void EvalParser::by_state::move (by_state& that) { @@ -227,12 +223,10 @@ namespace isc { namespace eval { that.clear (); } - inline EvalParser::by_state::by_state (state_type s) : state (s) {} - inline EvalParser::symbol_number_type EvalParser::by_state::type_get () const { @@ -242,55 +236,104 @@ namespace isc { namespace eval { return yystos_[state]; } - inline EvalParser::stack_symbol_type::stack_symbol_type () {} + EvalParser::stack_symbol_type::stack_symbol_type (const stack_symbol_type& that) + : super_type (that.state, that.location) + { + switch (that.type_get ()) + { + case 62: // option_repr_type + value.copy< TokenOption::RepresentationType > (that.value); + break; + + case 66: // pkt4_field + value.copy< TokenPkt4::FieldType > (that.value); + break; + + case 67: // pkt6_field + value.copy< TokenPkt6::FieldType > (that.value); + break; + + case 64: // pkt_metadata + value.copy< TokenPkt::MetadataType > (that.value); + break; + + case 68: // relay6_field + value.copy< TokenRelay6Field::FieldType > (that.value); + break; + + case 63: // nest_level + value.copy< int8_t > (that.value); + break; + + case 50: // "constant string" + case 51: // "integer" + case 52: // "constant hexstring" + case 53: // "option name" + case 54: // "ip address" + value.copy< std::string > (that.value); + break; + + case 61: // option_code + value.copy< uint16_t > (that.value); + break; + + case 60: // integer_expr + case 65: // enterprise_id + value.copy< uint32_t > (that.value); + break; + + default: + break; + } + + } - inline EvalParser::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that) : super_type (s, that.location) { - switch (that.type_get ()) + switch (that.type_get ()) { - case 61: // option_repr_type + case 62: // option_repr_type value.move< TokenOption::RepresentationType > (that.value); break; - case 65: // pkt4_field + case 66: // pkt4_field value.move< TokenPkt4::FieldType > (that.value); break; - case 66: // pkt6_field + case 67: // pkt6_field value.move< TokenPkt6::FieldType > (that.value); break; - case 63: // pkt_metadata + case 64: // pkt_metadata value.move< TokenPkt::MetadataType > (that.value); break; - case 67: // relay6_field + case 68: // relay6_field value.move< TokenRelay6Field::FieldType > (that.value); break; - case 62: // nest_level + case 63: // nest_level value.move< int8_t > (that.value); break; - case 49: // "constant string" - case 50: // "integer" - case 51: // "constant hexstring" - case 52: // "option name" - case 53: // "ip address" + case 50: // "constant string" + case 51: // "integer" + case 52: // "constant hexstring" + case 53: // "option name" + case 54: // "ip address" value.move< std::string > (that.value); break; - case 60: // option_code + case 61: // option_code value.move< uint16_t > (that.value); break; - case 59: // integer_expr - case 64: // enterprise_id + case 60: // integer_expr + case 65: // enterprise_id value.move< uint32_t > (that.value); break; @@ -302,51 +345,50 @@ namespace isc { namespace eval { that.type = empty_symbol; } - inline EvalParser::stack_symbol_type& EvalParser::stack_symbol_type::operator= (const stack_symbol_type& that) { state = that.state; - switch (that.type_get ()) + switch (that.type_get ()) { - case 61: // option_repr_type + case 62: // option_repr_type value.copy< TokenOption::RepresentationType > (that.value); break; - case 65: // pkt4_field + case 66: // pkt4_field value.copy< TokenPkt4::FieldType > (that.value); break; - case 66: // pkt6_field + case 67: // pkt6_field value.copy< TokenPkt6::FieldType > (that.value); break; - case 63: // pkt_metadata + case 64: // pkt_metadata value.copy< TokenPkt::MetadataType > (that.value); break; - case 67: // relay6_field + case 68: // relay6_field value.copy< TokenRelay6Field::FieldType > (that.value); break; - case 62: // nest_level + case 63: // nest_level value.copy< int8_t > (that.value); break; - case 49: // "constant string" - case 50: // "integer" - case 51: // "constant hexstring" - case 52: // "option name" - case 53: // "ip address" + case 50: // "constant string" + case 51: // "integer" + case 52: // "constant hexstring" + case 53: // "option name" + case 54: // "ip address" value.copy< std::string > (that.value); break; - case 60: // option_code + case 61: // option_code value.copy< uint16_t > (that.value); break; - case 59: // integer_expr - case 64: // enterprise_id + case 60: // integer_expr + case 65: // enterprise_id value.copy< uint32_t > (that.value); break; @@ -360,7 +402,6 @@ namespace isc { namespace eval { template <typename Base> - inline void EvalParser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const { @@ -386,102 +427,102 @@ namespace isc { namespace eval { << yysym.location << ": "; switch (yytype) { - case 49: // "constant string" + case 50: // "constant string" -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< std::string > (); } -#line 394 "parser.cc" // lalr1.cc:636 +#line 435 "parser.cc" // lalr1.cc:635 break; - case 50: // "integer" + case 51: // "integer" -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< std::string > (); } -#line 401 "parser.cc" // lalr1.cc:636 +#line 442 "parser.cc" // lalr1.cc:635 break; - case 51: // "constant hexstring" + case 52: // "constant hexstring" -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< std::string > (); } -#line 408 "parser.cc" // lalr1.cc:636 +#line 449 "parser.cc" // lalr1.cc:635 break; - case 52: // "option name" + case 53: // "option name" -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< std::string > (); } -#line 415 "parser.cc" // lalr1.cc:636 +#line 456 "parser.cc" // lalr1.cc:635 break; - case 53: // "ip address" + case 54: // "ip address" -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< std::string > (); } -#line 422 "parser.cc" // lalr1.cc:636 +#line 463 "parser.cc" // lalr1.cc:635 break; - case 59: // integer_expr + case 60: // integer_expr -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< uint32_t > (); } -#line 429 "parser.cc" // lalr1.cc:636 +#line 470 "parser.cc" // lalr1.cc:635 break; - case 60: // option_code + case 61: // option_code -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< uint16_t > (); } -#line 436 "parser.cc" // lalr1.cc:636 +#line 477 "parser.cc" // lalr1.cc:635 break; - case 61: // option_repr_type + case 62: // option_repr_type -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< TokenOption::RepresentationType > (); } -#line 443 "parser.cc" // lalr1.cc:636 +#line 484 "parser.cc" // lalr1.cc:635 break; - case 62: // nest_level + case 63: // nest_level -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< int8_t > (); } -#line 450 "parser.cc" // lalr1.cc:636 +#line 491 "parser.cc" // lalr1.cc:635 break; - case 63: // pkt_metadata + case 64: // pkt_metadata -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< TokenPkt::MetadataType > (); } -#line 457 "parser.cc" // lalr1.cc:636 +#line 498 "parser.cc" // lalr1.cc:635 break; - case 64: // enterprise_id + case 65: // enterprise_id -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< uint32_t > (); } -#line 464 "parser.cc" // lalr1.cc:636 +#line 505 "parser.cc" // lalr1.cc:635 break; - case 65: // pkt4_field + case 66: // pkt4_field -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< TokenPkt4::FieldType > (); } -#line 471 "parser.cc" // lalr1.cc:636 +#line 512 "parser.cc" // lalr1.cc:635 break; - case 66: // pkt6_field + case 67: // pkt6_field -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< TokenPkt6::FieldType > (); } -#line 478 "parser.cc" // lalr1.cc:636 +#line 519 "parser.cc" // lalr1.cc:635 break; - case 67: // relay6_field + case 68: // relay6_field -#line 110 "parser.yy" // lalr1.cc:636 +#line 111 "parser.yy" // lalr1.cc:635 { yyoutput << yysym.value.template as< TokenRelay6Field::FieldType > (); } -#line 485 "parser.cc" // lalr1.cc:636 +#line 526 "parser.cc" // lalr1.cc:635 break; @@ -492,7 +533,6 @@ namespace isc { namespace eval { } #endif - inline void EvalParser::yypush_ (const char* m, state_type s, symbol_type& sym) { @@ -500,7 +540,6 @@ namespace isc { namespace eval { yypush_ (m, t); } - inline void EvalParser::yypush_ (const char* m, stack_symbol_type& s) { @@ -509,9 +548,8 @@ namespace isc { namespace eval { yystack_.push (s); } - inline void - EvalParser::yypop_ (unsigned int n) + EvalParser::yypop_ (unsigned n) { yystack_.pop (n); } @@ -543,7 +581,7 @@ namespace isc { namespace eval { } #endif // EVALDEBUG - inline EvalParser::state_type + EvalParser::state_type EvalParser::yy_lr_goto_state_ (state_type yystate, int yysym) { int yyr = yypgoto_[yysym - yyntokens_] + yystate; @@ -553,13 +591,13 @@ namespace isc { namespace eval { return yydefgoto_[yysym - yyntokens_]; } - inline bool + bool EvalParser::yy_pact_value_is_default_ (int yyvalue) { return yyvalue == yypact_ninf_; } - inline bool + bool EvalParser::yy_table_value_is_error_ (int yyvalue) { return yyvalue == yytable_ninf_; @@ -590,7 +628,7 @@ namespace isc { namespace eval { // avoid gratuitous conflicts when merging into the master branch. try { - YYCDEBUG << "Starting parse" << std::endl; + YYCDEBUG << "Starting parse\n"; /* Initialize the stack. The initial state will be set in @@ -602,7 +640,7 @@ namespace isc { namespace eval { // A new symbol was pushed on the stack. yynewstate: - YYCDEBUG << "Entering state " << yystack_[0].state << std::endl; + YYCDEBUG << "Entering state " << yystack_[0].state << '\n'; // Accept? if (yystack_[0].state == yyfinal_) @@ -675,50 +713,50 @@ namespace isc { namespace eval { yylen = yyr2_[yyn]; { stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]); + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); /* Variants are always initialized to an empty instance of the correct type. The default '$$ = $1' action is NOT applied when using variants. */ - switch (yyr1_[yyn]) + switch (yyr1_[yyn]) { - case 61: // option_repr_type + case 62: // option_repr_type yylhs.value.build< TokenOption::RepresentationType > (); break; - case 65: // pkt4_field + case 66: // pkt4_field yylhs.value.build< TokenPkt4::FieldType > (); break; - case 66: // pkt6_field + case 67: // pkt6_field yylhs.value.build< TokenPkt6::FieldType > (); break; - case 63: // pkt_metadata + case 64: // pkt_metadata yylhs.value.build< TokenPkt::MetadataType > (); break; - case 67: // relay6_field + case 68: // relay6_field yylhs.value.build< TokenRelay6Field::FieldType > (); break; - case 62: // nest_level + case 63: // nest_level yylhs.value.build< int8_t > (); break; - case 49: // "constant string" - case 50: // "integer" - case 51: // "constant hexstring" - case 52: // "option name" - case 53: // "ip address" + case 50: // "constant string" + case 51: // "integer" + case 52: // "constant hexstring" + case 53: // "option name" + case 54: // "ip address" yylhs.value.build< std::string > (); break; - case 60: // option_code + case 61: // option_code yylhs.value.build< uint16_t > (); break; - case 59: // integer_expr - case 64: // enterprise_id + case 60: // integer_expr + case 65: // enterprise_id yylhs.value.build< uint32_t > (); break; @@ -727,10 +765,11 @@ namespace isc { namespace eval { } - // Compute the default @$. + // Default location. { slice<stack_symbol_type, stack_type> slice (yystack_, yylen); YYLLOC_DEFAULT (yylhs.location, slice, yylen); + yyerror_range[1].location = yylhs.location; } // Perform the reduction. @@ -740,52 +779,52 @@ namespace isc { namespace eval { switch (yyn) { case 6: -#line 130 "parser.yy" // lalr1.cc:859 +#line 131 "parser.yy" // lalr1.cc:856 { TokenPtr neg(new TokenNot()); ctx.expression.push_back(neg); } -#line 749 "parser.cc" // lalr1.cc:859 +#line 788 "parser.cc" // lalr1.cc:856 break; case 7: -#line 135 "parser.yy" // lalr1.cc:859 +#line 136 "parser.yy" // lalr1.cc:856 { TokenPtr neg(new TokenAnd()); ctx.expression.push_back(neg); } -#line 758 "parser.cc" // lalr1.cc:859 +#line 797 "parser.cc" // lalr1.cc:856 break; case 8: -#line 140 "parser.yy" // lalr1.cc:859 +#line 141 "parser.yy" // lalr1.cc:856 { TokenPtr neg(new TokenOr()); ctx.expression.push_back(neg); } -#line 767 "parser.cc" // lalr1.cc:859 +#line 806 "parser.cc" // lalr1.cc:856 break; case 9: -#line 145 "parser.yy" // lalr1.cc:859 +#line 146 "parser.yy" // lalr1.cc:856 { TokenPtr eq(new TokenEqual()); ctx.expression.push_back(eq); } -#line 776 "parser.cc" // lalr1.cc:859 +#line 815 "parser.cc" // lalr1.cc:856 break; case 10: -#line 150 "parser.yy" // lalr1.cc:859 +#line 151 "parser.yy" // lalr1.cc:856 { TokenPtr opt(new TokenOption(yystack_[3].value.as< uint16_t > (), TokenOption::EXISTS)); ctx.expression.push_back(opt); } -#line 785 "parser.cc" // lalr1.cc:859 +#line 824 "parser.cc" // lalr1.cc:856 break; case 11: -#line 155 "parser.yy" // lalr1.cc:859 +#line 156 "parser.yy" // lalr1.cc:856 { switch (ctx.getUniverse()) { case Option::V4: @@ -805,11 +844,11 @@ namespace isc { namespace eval { error(yystack_[5].location, "relay4 can only be used in DHCPv4."); } } -#line 809 "parser.cc" // lalr1.cc:859 +#line 848 "parser.cc" // lalr1.cc:856 break; case 12: -#line 175 "parser.yy" // lalr1.cc:859 +#line 176 "parser.yy" // lalr1.cc:856 { switch (ctx.getUniverse()) { case Option::V6: @@ -823,11 +862,11 @@ namespace isc { namespace eval { error(yystack_[10].location, "relay6 can only be used in DHCPv6."); } } -#line 827 "parser.cc" // lalr1.cc:859 +#line 866 "parser.cc" // lalr1.cc:856 break; case 13: -#line 189 "parser.yy" // lalr1.cc:859 +#line 190 "parser.yy" // lalr1.cc:856 { // Expression: vendor-class[1234].exists // @@ -836,11 +875,11 @@ namespace isc { namespace eval { TokenPtr exist(new TokenVendorClass(ctx.getUniverse(), yystack_[3].value.as< uint32_t > (), TokenOption::EXISTS)); ctx.expression.push_back(exist); } -#line 840 "parser.cc" // lalr1.cc:859 +#line 879 "parser.cc" // lalr1.cc:856 break; case 14: -#line 198 "parser.yy" // lalr1.cc:859 +#line 199 "parser.yy" // lalr1.cc:856 { // Expression: vendor[1234].exists // @@ -849,11 +888,11 @@ namespace isc { namespace eval { TokenPtr exist(new TokenVendor(ctx.getUniverse(), yystack_[3].value.as< uint32_t > (), TokenOption::EXISTS)); ctx.expression.push_back(exist); } -#line 853 "parser.cc" // lalr1.cc:859 +#line 892 "parser.cc" // lalr1.cc:856 break; case 15: -#line 207 "parser.yy" // lalr1.cc:859 +#line 208 "parser.yy" // lalr1.cc:856 { // Expression vendor[1234].option[123].exists // @@ -863,11 +902,11 @@ namespace isc { namespace eval { TokenPtr exist(new TokenVendor(ctx.getUniverse(), yystack_[8].value.as< uint32_t > (), TokenOption::EXISTS, yystack_[3].value.as< uint16_t > ())); ctx.expression.push_back(exist); } -#line 867 "parser.cc" // lalr1.cc:859 +#line 906 "parser.cc" // lalr1.cc:856 break; case 16: -#line 217 "parser.yy" // lalr1.cc:859 +#line 218 "parser.yy" // lalr1.cc:856 { // Expression member('foo') // @@ -882,47 +921,47 @@ namespace isc { namespace eval { TokenPtr member(new TokenMember(cc)); ctx.expression.push_back(member); } -#line 886 "parser.cc" // lalr1.cc:859 +#line 925 "parser.cc" // lalr1.cc:856 break; case 17: -#line 234 "parser.yy" // lalr1.cc:859 +#line 235 "parser.yy" // lalr1.cc:856 { TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ())); ctx.expression.push_back(str); } -#line 895 "parser.cc" // lalr1.cc:859 +#line 934 "parser.cc" // lalr1.cc:856 break; case 18: -#line 239 "parser.yy" // lalr1.cc:859 +#line 240 "parser.yy" // lalr1.cc:856 { TokenPtr hex(new TokenHexString(yystack_[0].value.as< std::string > ())); ctx.expression.push_back(hex); } -#line 904 "parser.cc" // lalr1.cc:859 +#line 943 "parser.cc" // lalr1.cc:856 break; case 19: -#line 244 "parser.yy" // lalr1.cc:859 +#line 245 "parser.yy" // lalr1.cc:856 { TokenPtr ip(new TokenIpAddress(yystack_[0].value.as< std::string > ())); ctx.expression.push_back(ip); } -#line 913 "parser.cc" // lalr1.cc:859 +#line 952 "parser.cc" // lalr1.cc:856 break; case 20: -#line 249 "parser.yy" // lalr1.cc:859 +#line 250 "parser.yy" // lalr1.cc:856 { TokenPtr opt(new TokenOption(yystack_[3].value.as< uint16_t > (), yystack_[0].value.as< TokenOption::RepresentationType > ())); ctx.expression.push_back(opt); } -#line 922 "parser.cc" // lalr1.cc:859 +#line 961 "parser.cc" // lalr1.cc:856 break; case 21: -#line 254 "parser.yy" // lalr1.cc:859 +#line 255 "parser.yy" // lalr1.cc:856 { switch (ctx.getUniverse()) { case Option::V4: @@ -942,11 +981,11 @@ namespace isc { namespace eval { error(yystack_[5].location, "relay4 can only be used in DHCPv4."); } } -#line 946 "parser.cc" // lalr1.cc:859 +#line 985 "parser.cc" // lalr1.cc:856 break; case 22: -#line 275 "parser.yy" // lalr1.cc:859 +#line 276 "parser.yy" // lalr1.cc:856 { switch (ctx.getUniverse()) { case Option::V6: @@ -960,20 +999,20 @@ namespace isc { namespace eval { error(yystack_[10].location, "relay6 can only be used in DHCPv6."); } } -#line 964 "parser.cc" // lalr1.cc:859 +#line 1003 "parser.cc" // lalr1.cc:856 break; case 23: -#line 290 "parser.yy" // lalr1.cc:859 +#line 291 "parser.yy" // lalr1.cc:856 { TokenPtr pkt_metadata(new TokenPkt(yystack_[0].value.as< TokenPkt::MetadataType > ())); ctx.expression.push_back(pkt_metadata); } -#line 973 "parser.cc" // lalr1.cc:859 +#line 1012 "parser.cc" // lalr1.cc:856 break; case 24: -#line 295 "parser.yy" // lalr1.cc:859 +#line 296 "parser.yy" // lalr1.cc:856 { switch (ctx.getUniverse()) { case Option::V4: @@ -987,11 +1026,11 @@ namespace isc { namespace eval { error(yystack_[2].location, "pkt4 can only be used in DHCPv4."); } } -#line 991 "parser.cc" // lalr1.cc:859 +#line 1030 "parser.cc" // lalr1.cc:856 break; case 25: -#line 309 "parser.yy" // lalr1.cc:859 +#line 310 "parser.yy" // lalr1.cc:856 { switch (ctx.getUniverse()) { case Option::V6: @@ -1005,11 +1044,11 @@ namespace isc { namespace eval { error(yystack_[2].location, "pkt6 can only be used in DHCPv6."); } } -#line 1009 "parser.cc" // lalr1.cc:859 +#line 1048 "parser.cc" // lalr1.cc:856 break; case 26: -#line 323 "parser.yy" // lalr1.cc:859 +#line 324 "parser.yy" // lalr1.cc:856 { switch (ctx.getUniverse()) { case Option::V6: @@ -1023,38 +1062,47 @@ namespace isc { namespace eval { error(yystack_[5].location, "relay6 can only be used in DHCPv6."); } } -#line 1027 "parser.cc" // lalr1.cc:859 +#line 1066 "parser.cc" // lalr1.cc:856 break; case 27: -#line 338 "parser.yy" // lalr1.cc:859 +#line 339 "parser.yy" // lalr1.cc:856 { TokenPtr sub(new TokenSubstring()); ctx.expression.push_back(sub); } -#line 1036 "parser.cc" // lalr1.cc:859 +#line 1075 "parser.cc" // lalr1.cc:856 break; case 28: -#line 343 "parser.yy" // lalr1.cc:859 +#line 344 "parser.yy" // lalr1.cc:856 { TokenPtr conc(new TokenConcat()); ctx.expression.push_back(conc); } -#line 1045 "parser.cc" // lalr1.cc:859 +#line 1084 "parser.cc" // lalr1.cc:856 break; case 29: -#line 348 "parser.yy" // lalr1.cc:859 +#line 349 "parser.yy" // lalr1.cc:856 { TokenPtr cond(new TokenIfElse()); ctx.expression.push_back(cond); } -#line 1054 "parser.cc" // lalr1.cc:859 +#line 1093 "parser.cc" // lalr1.cc:856 break; case 30: -#line 353 "parser.yy" // lalr1.cc:859 +#line 354 "parser.yy" // lalr1.cc:856 + { + TokenPtr tohex(new TokenToHexString()); + ctx.expression.push_back(tohex); + } +#line 1102 "parser.cc" // lalr1.cc:856 + break; + + case 31: +#line 359 "parser.yy" // lalr1.cc:856 { // expression: vendor.enterprise // @@ -1063,11 +1111,11 @@ namespace isc { namespace eval { TokenPtr vendor(new TokenVendor(ctx.getUniverse(), 0, TokenVendor::ENTERPRISE_ID)); ctx.expression.push_back(vendor); } -#line 1067 "parser.cc" // lalr1.cc:859 +#line 1115 "parser.cc" // lalr1.cc:856 break; - case 31: -#line 362 "parser.yy" // lalr1.cc:859 + case 32: +#line 368 "parser.yy" // lalr1.cc:856 { // expression: vendor-class.enterprise // @@ -1077,11 +1125,11 @@ namespace isc { namespace eval { TokenVendor::ENTERPRISE_ID)); ctx.expression.push_back(vendor); } -#line 1081 "parser.cc" // lalr1.cc:859 +#line 1129 "parser.cc" // lalr1.cc:856 break; - case 32: -#line 372 "parser.yy" // lalr1.cc:859 + case 33: +#line 378 "parser.yy" // lalr1.cc:856 { // This token will search for vendor option with // specified enterprise-id. If found, will search @@ -1090,11 +1138,11 @@ namespace isc { namespace eval { TokenPtr opt(new TokenVendor(ctx.getUniverse(), yystack_[8].value.as< uint32_t > (), yystack_[0].value.as< TokenOption::RepresentationType > (), yystack_[3].value.as< uint16_t > ())); ctx.expression.push_back(opt); } -#line 1094 "parser.cc" // lalr1.cc:859 +#line 1142 "parser.cc" // lalr1.cc:856 break; - case 33: -#line 381 "parser.yy" // lalr1.cc:859 + case 34: +#line 387 "parser.yy" // lalr1.cc:856 { // expression: vendor-class[1234].data // @@ -1107,11 +1155,11 @@ namespace isc { namespace eval { TokenVendor::DATA, 0)); ctx.expression.push_back(vendor_class); } -#line 1111 "parser.cc" // lalr1.cc:859 +#line 1159 "parser.cc" // lalr1.cc:856 break; - case 34: -#line 394 "parser.yy" // lalr1.cc:859 + case 35: +#line 400 "parser.yy" // lalr1.cc:856 { // expression: vendor-class[1234].data[5] // @@ -1124,247 +1172,247 @@ namespace isc { namespace eval { TokenVendor::DATA, index)); ctx.expression.push_back(vendor_class); } -#line 1128 "parser.cc" // lalr1.cc:859 +#line 1176 "parser.cc" // lalr1.cc:856 break; - case 35: -#line 407 "parser.yy" // lalr1.cc:859 + case 36: +#line 413 "parser.yy" // lalr1.cc:856 { TokenPtr integer(new TokenInteger(yystack_[0].value.as< uint32_t > ())); ctx.expression.push_back(integer); } -#line 1137 "parser.cc" // lalr1.cc:859 +#line 1185 "parser.cc" // lalr1.cc:856 break; - case 36: -#line 414 "parser.yy" // lalr1.cc:859 + case 37: +#line 420 "parser.yy" // lalr1.cc:856 { yylhs.value.as< uint32_t > () = ctx.convertUint32(yystack_[0].value.as< std::string > (), yystack_[0].location); } -#line 1145 "parser.cc" // lalr1.cc:859 +#line 1193 "parser.cc" // lalr1.cc:856 break; - case 37: -#line 420 "parser.yy" // lalr1.cc:859 + case 38: +#line 426 "parser.yy" // lalr1.cc:856 { yylhs.value.as< uint16_t > () = ctx.convertOptionCode(yystack_[0].value.as< std::string > (), yystack_[0].location); } -#line 1153 "parser.cc" // lalr1.cc:859 +#line 1201 "parser.cc" // lalr1.cc:856 break; - case 38: -#line 424 "parser.yy" // lalr1.cc:859 + case 39: +#line 430 "parser.yy" // lalr1.cc:856 { yylhs.value.as< uint16_t > () = ctx.convertOptionName(yystack_[0].value.as< std::string > (), yystack_[0].location); } -#line 1161 "parser.cc" // lalr1.cc:859 +#line 1209 "parser.cc" // lalr1.cc:856 break; - case 39: -#line 430 "parser.yy" // lalr1.cc:859 + case 40: +#line 436 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenOption::RepresentationType > () = TokenOption::TEXTUAL; } -#line 1169 "parser.cc" // lalr1.cc:859 +#line 1217 "parser.cc" // lalr1.cc:856 break; - case 40: -#line 434 "parser.yy" // lalr1.cc:859 + case 41: +#line 440 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenOption::RepresentationType > () = TokenOption::HEXADECIMAL; } -#line 1177 "parser.cc" // lalr1.cc:859 +#line 1225 "parser.cc" // lalr1.cc:856 break; - case 41: -#line 440 "parser.yy" // lalr1.cc:859 + case 42: +#line 446 "parser.yy" // lalr1.cc:856 { yylhs.value.as< int8_t > () = ctx.convertNestLevelNumber(yystack_[0].value.as< std::string > (), yystack_[0].location); } -#line 1185 "parser.cc" // lalr1.cc:859 +#line 1233 "parser.cc" // lalr1.cc:856 break; - case 42: -#line 449 "parser.yy" // lalr1.cc:859 + case 43: +#line 455 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::IFACE; } -#line 1193 "parser.cc" // lalr1.cc:859 +#line 1241 "parser.cc" // lalr1.cc:856 break; - case 43: -#line 453 "parser.yy" // lalr1.cc:859 + case 44: +#line 459 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::SRC; } -#line 1201 "parser.cc" // lalr1.cc:859 +#line 1249 "parser.cc" // lalr1.cc:856 break; - case 44: -#line 457 "parser.yy" // lalr1.cc:859 + case 45: +#line 463 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::DST; } -#line 1209 "parser.cc" // lalr1.cc:859 +#line 1257 "parser.cc" // lalr1.cc:856 break; - case 45: -#line 461 "parser.yy" // lalr1.cc:859 + case 46: +#line 467 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt::MetadataType > () = TokenPkt::LEN; } -#line 1217 "parser.cc" // lalr1.cc:859 +#line 1265 "parser.cc" // lalr1.cc:856 break; - case 46: -#line 467 "parser.yy" // lalr1.cc:859 + case 47: +#line 473 "parser.yy" // lalr1.cc:856 { yylhs.value.as< uint32_t > () = ctx.convertUint32(yystack_[0].value.as< std::string > (), yystack_[0].location); } -#line 1225 "parser.cc" // lalr1.cc:859 +#line 1273 "parser.cc" // lalr1.cc:856 break; - case 47: -#line 471 "parser.yy" // lalr1.cc:859 + case 48: +#line 477 "parser.yy" // lalr1.cc:856 { yylhs.value.as< uint32_t > () = 0; } -#line 1233 "parser.cc" // lalr1.cc:859 +#line 1281 "parser.cc" // lalr1.cc:856 break; - case 48: -#line 477 "parser.yy" // lalr1.cc:859 + case 49: +#line 483 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::CHADDR; } -#line 1241 "parser.cc" // lalr1.cc:859 +#line 1289 "parser.cc" // lalr1.cc:856 break; - case 49: -#line 481 "parser.yy" // lalr1.cc:859 + case 50: +#line 487 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::HLEN; } -#line 1249 "parser.cc" // lalr1.cc:859 +#line 1297 "parser.cc" // lalr1.cc:856 break; - case 50: -#line 485 "parser.yy" // lalr1.cc:859 + case 51: +#line 491 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::HTYPE; } -#line 1257 "parser.cc" // lalr1.cc:859 +#line 1305 "parser.cc" // lalr1.cc:856 break; - case 51: -#line 489 "parser.yy" // lalr1.cc:859 + case 52: +#line 495 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::CIADDR; } -#line 1265 "parser.cc" // lalr1.cc:859 +#line 1313 "parser.cc" // lalr1.cc:856 break; - case 52: -#line 493 "parser.yy" // lalr1.cc:859 + case 53: +#line 499 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::GIADDR; } -#line 1273 "parser.cc" // lalr1.cc:859 +#line 1321 "parser.cc" // lalr1.cc:856 break; - case 53: -#line 497 "parser.yy" // lalr1.cc:859 + case 54: +#line 503 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::YIADDR; } -#line 1281 "parser.cc" // lalr1.cc:859 +#line 1329 "parser.cc" // lalr1.cc:856 break; - case 54: -#line 501 "parser.yy" // lalr1.cc:859 + case 55: +#line 507 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::SIADDR; } -#line 1289 "parser.cc" // lalr1.cc:859 +#line 1337 "parser.cc" // lalr1.cc:856 break; - case 55: -#line 505 "parser.yy" // lalr1.cc:859 + case 56: +#line 511 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::MSGTYPE; } -#line 1297 "parser.cc" // lalr1.cc:859 +#line 1345 "parser.cc" // lalr1.cc:856 break; - case 56: -#line 509 "parser.yy" // lalr1.cc:859 + case 57: +#line 515 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt4::FieldType > () = TokenPkt4::TRANSID; } -#line 1305 "parser.cc" // lalr1.cc:859 +#line 1353 "parser.cc" // lalr1.cc:856 break; - case 57: -#line 515 "parser.yy" // lalr1.cc:859 + case 58: +#line 521 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt6::FieldType > () = TokenPkt6::MSGTYPE; } -#line 1313 "parser.cc" // lalr1.cc:859 +#line 1361 "parser.cc" // lalr1.cc:856 break; - case 58: -#line 519 "parser.yy" // lalr1.cc:859 + case 59: +#line 525 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenPkt6::FieldType > () = TokenPkt6::TRANSID; } -#line 1321 "parser.cc" // lalr1.cc:859 +#line 1369 "parser.cc" // lalr1.cc:856 break; - case 59: -#line 525 "parser.yy" // lalr1.cc:859 + case 60: +#line 531 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenRelay6Field::FieldType > () = TokenRelay6Field::PEERADDR; } -#line 1329 "parser.cc" // lalr1.cc:859 +#line 1377 "parser.cc" // lalr1.cc:856 break; - case 60: -#line 529 "parser.yy" // lalr1.cc:859 + case 61: +#line 535 "parser.yy" // lalr1.cc:856 { yylhs.value.as< TokenRelay6Field::FieldType > () = TokenRelay6Field::LINKADDR; } -#line 1337 "parser.cc" // lalr1.cc:859 +#line 1385 "parser.cc" // lalr1.cc:856 break; - case 61: -#line 535 "parser.yy" // lalr1.cc:859 + case 62: +#line 541 "parser.yy" // lalr1.cc:856 { TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ())); ctx.expression.push_back(str); } -#line 1346 "parser.cc" // lalr1.cc:859 +#line 1394 "parser.cc" // lalr1.cc:856 break; - case 62: -#line 542 "parser.yy" // lalr1.cc:859 + case 63: +#line 548 "parser.yy" // lalr1.cc:856 { TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ())); ctx.expression.push_back(str); } -#line 1355 "parser.cc" // lalr1.cc:859 +#line 1403 "parser.cc" // lalr1.cc:856 break; - case 63: -#line 547 "parser.yy" // lalr1.cc:859 + case 64: +#line 553 "parser.yy" // lalr1.cc:856 { TokenPtr str(new TokenString("all")); ctx.expression.push_back(str); } -#line 1364 "parser.cc" // lalr1.cc:859 +#line 1412 "parser.cc" // lalr1.cc:856 break; -#line 1368 "parser.cc" // lalr1.cc:859 +#line 1416 "parser.cc" // lalr1.cc:856 default: break; } @@ -1426,7 +1474,6 @@ namespace isc { namespace eval { code. */ if (false) goto yyerrorlab; - yyerror_range[1].location = yystack_[yylen - 1].location; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ yypop_ (yylen); @@ -1500,8 +1547,7 @@ namespace isc { namespace eval { } catch (...) { - YYCDEBUG << "Exception caught: cleaning lookahead and stack" - << std::endl; + YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; // Do not try to display the values of the reclaimed symbols, // as their printer might throw an exception. if (!yyla.empty ()) @@ -1519,7 +1565,7 @@ namespace isc { namespace eval { void EvalParser::error (const syntax_error& yyexc) { - error (yyexc.location, yyexc.what()); + error (yyexc.location, yyexc.what ()); } // Generate an error message. @@ -1595,12 +1641,13 @@ namespace isc { namespace eval { case N: \ yyformat = S; \ break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); #undef YYCASE_ } @@ -1619,153 +1666,156 @@ namespace isc { namespace eval { } - const signed char EvalParser::yypact_ninf_ = -114; + const signed char EvalParser::yypact_ninf_ = -118; const signed char EvalParser::yytable_ninf_ = -1; const short int EvalParser::yypact_[] = { - 18, 25, 72, 32, 25, 25, 14, 26, 37, 70, - 80, 84, 99, 105, 110, 100, 33, 90, -114, -114, - -114, -114, -114, 38, 116, -114, 101, 121, 122, 117, - 118, -114, -114, 73, -114, -38, -38, 89, 91, 47, - 59, 72, 72, 25, 20, -31, 95, -31, 96, 25, - 25, 72, -38, -38, 89, -31, -31, -114, -114, -114, - 127, 128, -114, 129, 142, -114, -114, -114, -114, -114, - -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, - 112, 113, -3, -114, -114, -114, -114, -114, 131, -114, - 134, -114, -114, 145, -114, 136, 137, 138, 139, 140, - 141, 143, 144, -114, 107, 72, 72, 146, 147, 148, - 149, 150, 151, 152, 5, 76, 13, -114, 123, 158, - 135, -14, 1, 66, 66, 29, 125, 163, -114, -114, - -114, -114, -114, -114, 159, -114, -114, -114, -30, -114, - 72, -114, 160, 161, -114, 162, 164, -38, -114, -114, - 169, 174, 130, -38, -38, -38, 165, -114, -114, 166, - 167, 168, 170, 171, -114, 172, 173, 175, 108, 111, - 66, 66, -114, -114, -114, -114 + -14, 27, 76, 17, 27, 27, 37, 41, 53, 39, + 52, 59, 77, 85, 93, 98, 88, 29, 94, -118, + -118, -118, -118, -118, 56, 104, -118, 114, 124, 129, + 119, 120, -118, -118, 7, -118, 87, 87, 67, 95, + 50, 62, 76, 76, 27, 76, 100, -35, 99, -35, + 101, 27, 27, 76, 87, 87, 67, -35, -35, -118, + -118, -118, 131, 133, -118, 134, 147, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, 116, 117, -3, 118, -118, -118, -118, -118, + -118, 139, -118, 140, -118, -118, 151, -118, 142, 143, + 144, 145, 146, 148, 149, 150, -118, 112, 76, 76, + 76, 152, 153, 154, 155, 156, 157, 158, 9, 64, + 12, -118, 128, 164, 141, 172, -15, 0, 103, 103, + 36, 132, 170, -118, -118, -118, -118, -118, -118, 165, + -118, -118, -118, -29, -118, 76, -118, -118, 166, 167, + -118, 168, 169, 87, -118, -118, 181, 182, 136, 87, + 87, 87, 173, -118, -118, 174, 175, 176, 177, 171, + -118, 178, 179, 180, 80, 113, 103, 103, -118, -118, + -118, -118 }; const unsigned char EvalParser::yydefact_[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 17, 36, - 18, 19, 2, 4, 0, 35, 0, 0, 0, 0, - 0, 3, 1, 0, 6, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, + 37, 18, 19, 2, 4, 0, 36, 0, 0, 0, + 0, 0, 3, 1, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 5, 37, 38, - 0, 0, 41, 0, 0, 42, 43, 44, 45, 23, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 24, - 0, 0, 0, 57, 58, 25, 47, 46, 0, 31, - 0, 30, 7, 8, 9, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 39, 40, - 10, 20, 11, 21, 0, 59, 60, 26, 0, 28, - 0, 13, 33, 0, 14, 0, 0, 0, 63, 62, - 0, 0, 0, 0, 0, 0, 0, 27, 29, 0, - 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, - 0, 0, 12, 22, 15, 32 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, + 38, 39, 0, 0, 42, 0, 0, 43, 44, 45, + 46, 23, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 24, 0, 0, 0, 0, 58, 59, 25, 48, + 47, 0, 32, 0, 31, 7, 8, 9, 0, 0, + 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 40, 41, 10, 20, 11, 21, 0, + 60, 61, 26, 0, 28, 0, 30, 13, 34, 0, + 14, 0, 0, 0, 64, 63, 0, 0, 0, 0, + 0, 0, 0, 27, 29, 0, 0, 0, 0, 0, + 35, 0, 0, 0, 0, 0, 0, 0, 12, 22, + 15, 33 }; const short int EvalParser::yypgoto_[] = { - -114, -114, -114, 4, -2, -114, -35, -113, 133, -114, - -40, -114, -114, -114, -114, -114 + -118, -118, -118, 3, -2, -118, -36, -117, 138, -118, + -34, -118, -118, -118, -118, -118 }; const short int EvalParser::yydefgoto_[] = { - -1, 3, 22, 23, 24, 25, 60, 131, 63, 69, - 88, 79, 85, 137, 118, 150 + -1, 3, 23, 24, 25, 26, 62, 136, 65, 71, + 91, 81, 88, 142, 122, 156 }; const unsigned char EvalParser::yytable_[] = { - 31, 61, 133, 49, 50, 148, 141, 90, 33, 34, - 143, 133, 58, 86, 59, 98, 99, 95, 96, 87, - 149, 144, 134, 128, 129, 130, 135, 136, 4, 35, - 5, 142, 32, 106, 6, 7, 8, 9, 145, 80, - 81, 36, 135, 136, 49, 50, 10, 82, 45, 94, - 46, 11, 37, 92, 93, 173, 175, 173, 175, 12, - 83, 84, 13, 14, 15, 1, 2, 16, 17, 65, - 66, 67, 68, 38, 18, 19, 20, 57, 21, 49, - 50, 26, 27, 28, 128, 129, 70, 71, 72, 73, - 74, 75, 76, 10, 128, 129, 132, 39, 11, 77, - 78, 40, 41, 119, 120, 47, 12, 48, 42, 13, - 14, 15, 156, 43, 29, 30, 52, 44, 160, 161, - 162, 18, 19, 20, 51, 21, 128, 129, 172, 128, - 129, 174, 55, 56, 46, 48, 53, 54, 151, 62, - 64, 89, 91, 100, 101, 102, 103, 107, 104, 105, - 108, 49, 109, 110, 111, 112, 113, 117, 114, 138, - 115, 116, 139, 121, 122, 123, 124, 125, 126, 127, - 142, 140, 146, 157, 147, 152, 153, 154, 158, 155, - 159, 163, 164, 165, 166, 0, 167, 97, 168, 169, - 170, 0, 171 + 32, 63, 138, 51, 52, 147, 154, 34, 35, 149, + 89, 59, 138, 51, 52, 93, 90, 33, 98, 99, + 150, 139, 155, 101, 102, 140, 141, 133, 134, 135, + 4, 148, 5, 109, 1, 2, 6, 7, 8, 9, + 82, 83, 39, 85, 47, 151, 48, 84, 10, 140, + 141, 97, 36, 11, 95, 96, 37, 179, 181, 179, + 181, 12, 51, 52, 13, 14, 15, 16, 38, 40, + 17, 18, 67, 68, 69, 70, 41, 19, 20, 21, + 42, 22, 133, 134, 137, 27, 28, 29, 43, 72, + 73, 74, 75, 76, 77, 78, 44, 10, 133, 134, + 178, 45, 11, 79, 80, 46, 123, 124, 125, 49, + 12, 50, 53, 13, 14, 15, 16, 162, 64, 30, + 31, 133, 134, 166, 167, 168, 19, 20, 21, 54, + 22, 133, 134, 180, 57, 58, 48, 50, 60, 55, + 61, 86, 87, 157, 56, 66, 92, 103, 94, 104, + 105, 106, 107, 108, 110, 111, 112, 51, 113, 114, + 115, 116, 117, 121, 143, 118, 119, 120, 144, 126, + 127, 128, 129, 130, 131, 132, 146, 145, 148, 152, + 153, 158, 159, 160, 161, 163, 164, 165, 174, 169, + 170, 171, 172, 173, 100, 175, 176, 177 }; - const short int + const unsigned char EvalParser::yycheck_[] = { - 2, 36, 115, 6, 7, 35, 20, 47, 4, 5, - 9, 124, 50, 44, 52, 55, 56, 52, 53, 50, - 50, 20, 9, 18, 19, 20, 13, 14, 3, 15, - 5, 45, 0, 36, 9, 10, 11, 12, 9, 41, - 42, 15, 13, 14, 6, 7, 21, 43, 15, 51, - 17, 26, 15, 49, 50, 168, 169, 170, 171, 34, - 40, 41, 37, 38, 39, 47, 48, 42, 43, 22, - 23, 24, 25, 3, 49, 50, 51, 4, 53, 6, - 7, 9, 10, 11, 18, 19, 27, 28, 29, 30, - 31, 32, 33, 21, 18, 19, 20, 17, 26, 40, - 41, 17, 3, 105, 106, 15, 34, 17, 3, 37, - 38, 39, 147, 3, 42, 43, 15, 17, 153, 154, - 155, 49, 50, 51, 8, 53, 18, 19, 20, 18, - 19, 20, 15, 15, 17, 17, 15, 15, 140, 50, - 49, 46, 46, 16, 16, 16, 4, 16, 36, 36, - 16, 6, 16, 16, 16, 16, 16, 50, 17, 36, - 17, 17, 4, 17, 17, 17, 17, 17, 17, 17, - 45, 36, 9, 4, 15, 15, 15, 15, 4, 15, - 50, 16, 16, 16, 16, -1, 16, 54, 17, 17, - 17, -1, 17 + 2, 37, 119, 6, 7, 20, 35, 4, 5, 9, + 45, 4, 129, 6, 7, 49, 51, 0, 54, 55, + 20, 9, 51, 57, 58, 13, 14, 18, 19, 20, + 3, 46, 5, 36, 48, 49, 9, 10, 11, 12, + 42, 43, 3, 45, 15, 9, 17, 44, 21, 13, + 14, 53, 15, 26, 51, 52, 15, 174, 175, 176, + 177, 34, 6, 7, 37, 38, 39, 40, 15, 17, + 43, 44, 22, 23, 24, 25, 17, 50, 51, 52, + 3, 54, 18, 19, 20, 9, 10, 11, 3, 27, + 28, 29, 30, 31, 32, 33, 3, 21, 18, 19, + 20, 3, 26, 41, 42, 17, 108, 109, 110, 15, + 34, 17, 8, 37, 38, 39, 40, 153, 51, 43, + 44, 18, 19, 159, 160, 161, 50, 51, 52, 15, + 54, 18, 19, 20, 15, 15, 17, 17, 51, 15, + 53, 41, 42, 145, 15, 50, 47, 16, 47, 16, + 16, 4, 36, 36, 36, 16, 16, 6, 16, 16, + 16, 16, 16, 51, 36, 17, 17, 17, 4, 17, + 17, 17, 17, 17, 17, 17, 4, 36, 46, 9, + 15, 15, 15, 15, 15, 4, 4, 51, 17, 16, + 16, 16, 16, 16, 56, 17, 17, 17 }; const unsigned char EvalParser::yystos_[] = { - 0, 47, 48, 55, 3, 5, 9, 10, 11, 12, - 21, 26, 34, 37, 38, 39, 42, 43, 49, 50, - 51, 53, 56, 57, 58, 59, 9, 10, 11, 42, - 43, 58, 0, 57, 57, 15, 15, 15, 3, 17, - 17, 3, 3, 3, 17, 15, 17, 15, 17, 6, - 7, 8, 15, 15, 15, 15, 15, 4, 50, 52, - 60, 60, 50, 62, 49, 22, 23, 24, 25, 63, - 27, 28, 29, 30, 31, 32, 33, 40, 41, 65, - 58, 58, 57, 40, 41, 66, 44, 50, 64, 46, - 64, 46, 57, 57, 58, 60, 60, 62, 64, 64, - 16, 16, 16, 4, 36, 36, 36, 16, 16, 16, - 16, 16, 16, 16, 17, 17, 17, 50, 68, 58, - 58, 17, 17, 17, 17, 17, 17, 17, 18, 19, - 20, 61, 20, 61, 9, 13, 14, 67, 36, 4, - 36, 20, 45, 9, 20, 9, 9, 15, 35, 50, - 69, 58, 15, 15, 15, 15, 60, 4, 4, 50, - 60, 60, 60, 16, 16, 16, 16, 16, 17, 17, - 17, 17, 20, 61, 20, 61 + 0, 48, 49, 56, 3, 5, 9, 10, 11, 12, + 21, 26, 34, 37, 38, 39, 40, 43, 44, 50, + 51, 52, 54, 57, 58, 59, 60, 9, 10, 11, + 43, 44, 59, 0, 58, 58, 15, 15, 15, 3, + 17, 17, 3, 3, 3, 3, 17, 15, 17, 15, + 17, 6, 7, 8, 15, 15, 15, 15, 15, 4, + 51, 53, 61, 61, 51, 63, 50, 22, 23, 24, + 25, 64, 27, 28, 29, 30, 31, 32, 33, 41, + 42, 66, 59, 59, 58, 59, 41, 42, 67, 45, + 51, 65, 47, 65, 47, 58, 58, 59, 61, 61, + 63, 65, 65, 16, 16, 16, 4, 36, 36, 36, + 36, 16, 16, 16, 16, 16, 16, 16, 17, 17, + 17, 51, 69, 59, 59, 59, 17, 17, 17, 17, + 17, 17, 17, 18, 19, 20, 62, 20, 62, 9, + 13, 14, 68, 36, 4, 36, 4, 20, 46, 9, + 20, 9, 9, 15, 35, 51, 70, 59, 15, 15, + 15, 15, 61, 4, 4, 51, 61, 61, 61, 16, + 16, 16, 16, 16, 17, 17, 17, 17, 20, 62, + 20, 62 }; const unsigned char EvalParser::yyr1_[] = { - 0, 54, 55, 55, 56, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 59, 60, 60, 61, - 61, 62, 63, 63, 63, 63, 64, 64, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 66, 66, 67, - 67, 68, 69, 69 + 0, 55, 56, 56, 57, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 59, 60, 61, 61, + 62, 62, 63, 64, 64, 64, 64, 65, 65, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 67, 67, + 68, 68, 69, 70, 70 }; const unsigned char @@ -1774,10 +1824,10 @@ namespace isc { namespace eval { 0, 2, 2, 2, 1, 3, 2, 3, 3, 3, 6, 6, 11, 6, 6, 11, 4, 1, 1, 1, 6, 6, 11, 3, 3, 3, 6, 8, 6, 8, - 3, 3, 11, 6, 9, 1, 1, 1, 1, 1, + 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 }; @@ -1793,28 +1843,28 @@ namespace isc { namespace eval { "\"text\"", "\"hex\"", "\"exists\"", "\"pkt\"", "\"iface\"", "\"src\"", "\"dst\"", "\"len\"", "\"pkt4\"", "\"mac\"", "\"hlen\"", "\"htype\"", "\"ciaddr\"", "\"giaddr\"", "\"yiaddr\"", "\"siaddr\"", "\"substring\"", - "\"all\"", "\",\"", "\"concat\"", "\"ifelse\"", "\"pkt6\"", - "\"msgtype\"", "\"transid\"", "\"vendor-class\"", "\"vendor\"", "\"*\"", - "\"data\"", "\"enterprise\"", "\"top-level bool\"", - "\"top-level string\"", "\"constant string\"", "\"integer\"", - "\"constant hexstring\"", "\"option name\"", "\"ip address\"", "$accept", - "start", "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 + "\"all\"", "\",\"", "\"concat\"", "\"ifelse\"", "\"hexstring\"", + "\"pkt6\"", "\"msgtype\"", "\"transid\"", "\"vendor-class\"", + "\"vendor\"", "\"*\"", "\"data\"", "\"enterprise\"", + "\"top-level bool\"", "\"top-level string\"", "\"constant string\"", + "\"integer\"", "\"constant hexstring\"", "\"option name\"", + "\"ip address\"", "$accept", "start", "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 }; #if EVALDEBUG const unsigned short int EvalParser::yyrline_[] = { - 0, 119, 119, 120, 125, 128, 129, 134, 139, 144, - 149, 154, 174, 188, 197, 206, 216, 233, 238, 243, - 248, 253, 274, 289, 294, 308, 322, 337, 342, 347, - 352, 361, 371, 380, 393, 406, 413, 419, 423, 429, - 433, 439, 448, 452, 456, 460, 466, 470, 476, 480, - 484, 488, 492, 496, 500, 504, 508, 514, 518, 524, - 528, 534, 541, 546 + 0, 120, 120, 121, 126, 129, 130, 135, 140, 145, + 150, 155, 175, 189, 198, 207, 217, 234, 239, 244, + 249, 254, 275, 290, 295, 309, 323, 338, 343, 348, + 353, 358, 367, 377, 386, 399, 412, 419, 425, 429, + 435, 439, 445, 454, 458, 462, 466, 472, 476, 482, + 486, 490, 494, 498, 502, 506, 510, 514, 520, 524, + 530, 534, 540, 547, 552 }; // Print the state stack on the debug stream. @@ -1827,18 +1877,18 @@ namespace isc { namespace eval { i_end = yystack_.end (); i != i_end; ++i) *yycdebug_ << ' ' << i->state; - *yycdebug_ << std::endl; + *yycdebug_ << '\n'; } // Report on the debug stream that the rule \a yyrule is going to be reduced. void EvalParser::yy_reduce_print_ (int yyrule) { - unsigned int yylno = yyrline_[yyrule]; + unsigned yylno = yyrline_[yyrule]; int yynrhs = yyr2_[yyrule]; // Print the symbols being reduced, and their result. *yycdebug_ << "Reducing stack by rule " << yyrule - 1 - << " (line " << yylno << "):" << std::endl; + << " (line " << yylno << "):\n"; // The symbols being reduced. for (int yyi = 0; yyi < yynrhs; yyi++) YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", @@ -1847,10 +1897,10 @@ namespace isc { namespace eval { #endif // EVALDEBUG -#line 14 "parser.yy" // lalr1.cc:1167 +#line 14 "parser.yy" // lalr1.cc:1163 } } // isc::eval -#line 1853 "parser.cc" // lalr1.cc:1167 -#line 553 "parser.yy" // lalr1.cc:1168 +#line 1903 "parser.cc" // lalr1.cc:1163 +#line 559 "parser.yy" // lalr1.cc:1164 void isc::eval::EvalParser::error(const location_type& loc, diff --git a/src/lib/eval/parser.h b/src/lib/eval/parser.h index 7b8614a2ad..c79f0fddbb 100644 --- a/src/lib/eval/parser.h +++ b/src/lib/eval/parser.h @@ -1,8 +1,8 @@ -// A Bison parser, made by GNU Bison 3.0.4. +// A Bison parser, made by GNU Bison 3.0.5. // Skeleton interface for Bison LALR(1) parsers in C++ -// Copyright (C) 2002-2015 Free Software Foundation, Inc. +// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -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:379 #include <string> #include <eval/token.h> @@ -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:379 # include <cassert> # include <cstdlib> // 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:379 namespace isc { namespace eval { -#line 140 "parser.h" // lalr1.cc:377 +#line 140 "parser.h" // lalr1.cc:379 @@ -393,21 +393,22 @@ namespace isc { namespace eval { TOKEN_COMA = 291, TOKEN_CONCAT = 292, TOKEN_IFELSE = 293, - TOKEN_PKT6 = 294, - TOKEN_MSGTYPE = 295, - TOKEN_TRANSID = 296, - TOKEN_VENDOR_CLASS = 297, - TOKEN_VENDOR = 298, - TOKEN_ANY = 299, - TOKEN_DATA = 300, - TOKEN_ENTERPRISE = 301, - TOKEN_TOPLEVEL_BOOL = 302, - TOKEN_TOPLEVEL_STRING = 303, - TOKEN_STRING = 304, - TOKEN_INTEGER = 305, - TOKEN_HEXSTRING = 306, - TOKEN_OPTION_NAME = 307, - TOKEN_IP_ADDRESS = 308 + TOKEN_TOHEXSTRING = 294, + TOKEN_PKT6 = 295, + TOKEN_MSGTYPE = 296, + TOKEN_TRANSID = 297, + TOKEN_VENDOR_CLASS = 298, + TOKEN_VENDOR = 299, + TOKEN_ANY = 300, + TOKEN_DATA = 301, + TOKEN_ENTERPRISE = 302, + TOKEN_TOPLEVEL_BOOL = 303, + TOKEN_TOPLEVEL_STRING = 304, + TOKEN_STRING = 305, + TOKEN_INTEGER = 306, + TOKEN_HEXSTRING = 307, + TOKEN_OPTION_NAME = 308, + TOKEN_IP_ADDRESS = 309 }; }; @@ -680,6 +681,10 @@ namespace isc { namespace eval { static inline symbol_type + make_TOHEXSTRING (const location_type& l); + + static inline + symbol_type make_PKT6 (const location_type& l); static inline @@ -823,7 +828,7 @@ namespace isc { namespace eval { // number is the opposite. If YYTABLE_NINF, syntax error. static const unsigned char yytable_[]; - static const short int yycheck_[]; + static const unsigned char yycheck_[]; // YYSTOS[STATE-NUM] -- The (internal number of the) accessing // symbol of state STATE-NUM. @@ -909,6 +914,8 @@ namespace isc { namespace eval { typedef basic_symbol<by_state> super_type; /// Construct an empty symbol. stack_symbol_type (); + /// Copy construct. + stack_symbol_type (const stack_symbol_type& that); /// Steal the contents from \a sym to build this. stack_symbol_type (state_type s, symbol_type& sym); /// Assignment, needed by push_back. @@ -937,18 +944,18 @@ namespace isc { namespace eval { void yypush_ (const char* m, state_type s, symbol_type& sym); /// Pop \a n symbols the three stacks. - void yypop_ (unsigned int n = 1); + void yypop_ (unsigned n = 1); /// Constants. enum { yyeof_ = 0, - yylast_ = 192, ///< Last index in yytable_. + yylast_ = 197, ///< Last index in yytable_. yynnts_ = 16, ///< Number of nonterminal symbols. - yyfinal_ = 32, ///< Termination state number. + yyfinal_ = 33, ///< Termination state number. yyterror_ = 1, yyerrcode_ = 256, - yyntokens_ = 54 ///< Number of tokens. + yyntokens_ = 55 ///< Number of tokens. }; @@ -995,14 +1002,14 @@ 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, 50, 51, 52, 53 + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54 }; - const unsigned int user_token_number_max_ = 308; + const unsigned user_token_number_max_ = 309; const token_number_type undef_token_ = 2; - if (static_cast<int>(t) <= yyeof_) + if (static_cast<int> (t) <= yyeof_) return yyeof_; - else if (static_cast<unsigned int> (t) <= user_token_number_max_) + else if (static_cast<unsigned> (t) <= user_token_number_max_) return translate_table[t]; else return undef_token_; @@ -1016,58 +1023,56 @@ namespace isc { namespace eval { // basic_symbol. template <typename Base> - inline EvalParser::basic_symbol<Base>::basic_symbol () : value () {} template <typename Base> - inline EvalParser::basic_symbol<Base>::basic_symbol (const basic_symbol& other) : Base (other) , value () , location (other.location) { - switch (other.type_get ()) + switch (other.type_get ()) { - case 61: // option_repr_type + case 62: // option_repr_type value.copy< TokenOption::RepresentationType > (other.value); break; - case 65: // pkt4_field + case 66: // pkt4_field value.copy< TokenPkt4::FieldType > (other.value); break; - case 66: // pkt6_field + case 67: // pkt6_field value.copy< TokenPkt6::FieldType > (other.value); break; - case 63: // pkt_metadata + case 64: // pkt_metadata value.copy< TokenPkt::MetadataType > (other.value); break; - case 67: // relay6_field + case 68: // relay6_field value.copy< TokenRelay6Field::FieldType > (other.value); break; - case 62: // nest_level + case 63: // nest_level value.copy< int8_t > (other.value); break; - case 49: // "constant string" - case 50: // "integer" - case 51: // "constant hexstring" - case 52: // "option name" - case 53: // "ip address" + case 50: // "constant string" + case 51: // "integer" + case 52: // "constant hexstring" + case 53: // "option name" + case 54: // "ip address" value.copy< std::string > (other.value); break; - case 60: // option_code + case 61: // option_code value.copy< uint16_t > (other.value); break; - case 59: // integer_expr - case 64: // enterprise_id + case 60: // integer_expr + case 65: // enterprise_id value.copy< uint32_t > (other.value); break; @@ -1077,55 +1082,53 @@ namespace isc { namespace eval { } - template <typename Base> - inline EvalParser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const semantic_type& v, const location_type& l) : Base (t) , value () , location (l) { (void) v; - switch (this->type_get ()) + switch (this->type_get ()) { - case 61: // option_repr_type + case 62: // option_repr_type value.copy< TokenOption::RepresentationType > (v); break; - case 65: // pkt4_field + case 66: // pkt4_field value.copy< TokenPkt4::FieldType > (v); break; - case 66: // pkt6_field + case 67: // pkt6_field value.copy< TokenPkt6::FieldType > (v); break; - case 63: // pkt_metadata + case 64: // pkt_metadata value.copy< TokenPkt::MetadataType > (v); break; - case 67: // relay6_field + case 68: // relay6_field value.copy< TokenRelay6Field::FieldType > (v); break; - case 62: // nest_level + case 63: // nest_level value.copy< int8_t > (v); break; - case 49: // "constant string" - case 50: // "integer" - case 51: // "constant hexstring" - case 52: // "option name" - case 53: // "ip address" + case 50: // "constant string" + case 51: // "integer" + case 52: // "constant hexstring" + case 53: // "option name" + case 54: // "ip address" value.copy< std::string > (v); break; - case 60: // option_code + case 61: // option_code value.copy< uint16_t > (v); break; - case 59: // integer_expr - case 64: // enterprise_id + case 60: // integer_expr + case 65: // enterprise_id value.copy< uint32_t > (v); break; @@ -1209,14 +1212,12 @@ namespace isc { namespace eval { template <typename Base> - inline EvalParser::basic_symbol<Base>::~basic_symbol () { clear (); } template <typename Base> - inline void EvalParser::basic_symbol<Base>::clear () { @@ -1231,46 +1232,46 @@ namespace isc { namespace eval { } // Type destructor. - switch (yytype) + switch (yytype) { - case 61: // option_repr_type + case 62: // option_repr_type value.template destroy< TokenOption::RepresentationType > (); break; - case 65: // pkt4_field + case 66: // pkt4_field value.template destroy< TokenPkt4::FieldType > (); break; - case 66: // pkt6_field + case 67: // pkt6_field value.template destroy< TokenPkt6::FieldType > (); break; - case 63: // pkt_metadata + case 64: // pkt_metadata value.template destroy< TokenPkt::MetadataType > (); break; - case 67: // relay6_field + case 68: // relay6_field value.template destroy< TokenRelay6Field::FieldType > (); break; - case 62: // nest_level + case 63: // nest_level value.template destroy< int8_t > (); break; - case 49: // "constant string" - case 50: // "integer" - case 51: // "constant hexstring" - case 52: // "option name" - case 53: // "ip address" + case 50: // "constant string" + case 51: // "integer" + case 52: // "constant hexstring" + case 53: // "option name" + case 54: // "ip address" value.template destroy< std::string > (); break; - case 60: // option_code + case 61: // option_code value.template destroy< uint16_t > (); break; - case 59: // integer_expr - case 64: // enterprise_id + case 60: // integer_expr + case 65: // enterprise_id value.template destroy< uint32_t > (); break; @@ -1282,7 +1283,6 @@ namespace isc { namespace eval { } template <typename Base> - inline bool EvalParser::basic_symbol<Base>::empty () const { @@ -1290,51 +1290,50 @@ namespace isc { namespace eval { } template <typename Base> - inline void EvalParser::basic_symbol<Base>::move (basic_symbol& s) { - super_type::move(s); - switch (this->type_get ()) + super_type::move (s); + switch (this->type_get ()) { - case 61: // option_repr_type + case 62: // option_repr_type value.move< TokenOption::RepresentationType > (s.value); break; - case 65: // pkt4_field + case 66: // pkt4_field value.move< TokenPkt4::FieldType > (s.value); break; - case 66: // pkt6_field + case 67: // pkt6_field value.move< TokenPkt6::FieldType > (s.value); break; - case 63: // pkt_metadata + case 64: // pkt_metadata value.move< TokenPkt::MetadataType > (s.value); break; - case 67: // relay6_field + case 68: // relay6_field value.move< TokenRelay6Field::FieldType > (s.value); break; - case 62: // nest_level + case 63: // nest_level value.move< int8_t > (s.value); break; - case 49: // "constant string" - case 50: // "integer" - case 51: // "constant hexstring" - case 52: // "option name" - case 53: // "ip address" + case 50: // "constant string" + case 51: // "integer" + case 52: // "constant hexstring" + case 53: // "option name" + case 54: // "ip address" value.move< std::string > (s.value); break; - case 60: // option_code + case 61: // option_code value.move< uint16_t > (s.value); break; - case 59: // integer_expr - case 64: // enterprise_id + case 60: // integer_expr + case 65: // enterprise_id value.move< uint32_t > (s.value); break; @@ -1398,7 +1397,7 @@ namespace isc { namespace eval { 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308 + 305, 306, 307, 308, 309 }; return static_cast<token_type> (yytoken_number_[type]); } @@ -1626,6 +1625,12 @@ namespace isc { namespace eval { } EvalParser::symbol_type + EvalParser::make_TOHEXSTRING (const location_type& l) + { + return symbol_type (token::TOKEN_TOHEXSTRING, l); + } + + EvalParser::symbol_type EvalParser::make_PKT6 (const location_type& l) { return symbol_type (token::TOKEN_PKT6, l); @@ -1716,9 +1721,9 @@ namespace isc { namespace eval { } -#line 14 "parser.yy" // lalr1.cc:377 +#line 14 "parser.yy" // lalr1.cc:379 } } // isc::eval -#line 1722 "parser.h" // lalr1.cc:377 +#line 1727 "parser.h" // lalr1.cc:379 diff --git a/src/lib/eval/position.hh b/src/lib/eval/position.hh index 6d547f2746..cb72c16895 100644 --- a/src/lib/eval/position.hh +++ b/src/lib/eval/position.hh @@ -1,8 +1,9 @@ -// A Bison parser, made by GNU Bison 3.0.4. +// Generated 201809161042 +// A Bison parser, made by GNU Bison 3.0.5. // Positions for Bison parsers in C++ -// Copyright (C) 2002-2015 Free Software Foundation, Inc. +// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -50,28 +51,27 @@ # endif # endif -#line 14 "parser.yy" // location.cc:296 +#line 14 "parser.yy" // location.cc:292 namespace isc { namespace eval { -#line 56 "position.hh" // location.cc:296 +#line 56 "position.hh" // location.cc:292 /// Abstract a position. class position { public: /// Construct a position. explicit position (std::string* f = YY_NULLPTR, - unsigned int l = 1u, - unsigned int c = 1u) + unsigned l = 1u, + unsigned c = 1u) : filename (f) , line (l) , column (c) - { - } + {} /// Initialization. void initialize (std::string* fn = YY_NULLPTR, - unsigned int l = 1u, - unsigned int c = 1u) + unsigned l = 1u, + unsigned c = 1u) { filename = fn; line = l; @@ -100,15 +100,15 @@ namespace isc { namespace eval { /// File name to which this position refers. std::string* filename; /// Current line number. - unsigned int line; + unsigned line; /// Current column number. - unsigned int column; + unsigned column; private: /// Compute max(min, lhs+rhs) (provided min <= lhs). - static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min) + static unsigned add_ (unsigned lhs, int rhs, unsigned min) { - return (0 < rhs || -static_cast<unsigned int>(rhs) < lhs + return (0 < rhs || -static_cast<unsigned>(rhs) < lhs ? rhs + lhs : min); } @@ -174,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:292 } } // isc::eval -#line 180 "position.hh" // location.cc:296 +#line 179 "position.hh" // location.cc:292 #endif // !YY_EVAL_POSITION_HH_INCLUDED diff --git a/src/lib/eval/stack.hh b/src/lib/eval/stack.hh index e0d2dfe10f..2d70e54f4b 100644 --- a/src/lib/eval/stack.hh +++ b/src/lib/eval/stack.hh @@ -1,8 +1,9 @@ -// A Bison parser, made by GNU Bison 3.0.4. +// Generated 201809161042 +// A Bison parser, made by GNU Bison 3.0.5. // Stack handling for Bison parsers in C++ -// Copyright (C) 2002-2015 Free Software Foundation, Inc. +// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -40,9 +41,10 @@ # include <vector> -#line 14 "parser.yy" // stack.hh:132 +#line 14 "parser.yy" // stack.hh:131 namespace isc { namespace eval { -#line 46 "stack.hh" // stack.hh:132 +#line 46 "stack.hh" // stack.hh:131 + /// A stack with random access from its top. template <class T, class S = std::vector<T> > class stack { @@ -57,20 +59,24 @@ namespace isc { namespace eval { seq_.reserve (200); } - stack (unsigned int n) + stack (unsigned n) : seq_ (n) {} - inline + /// Random access. + /// + /// Index 0 returns the topmost element. T& - operator[] (unsigned int i) + operator[] (unsigned i) { return seq_[seq_.size () - 1 - i]; } - inline + /// Random access. + /// + /// Index 0 returns the topmost element. const T& - operator[] (unsigned int i) const + operator[] (unsigned i) const { return seq_[seq_.size () - 1 - i]; } @@ -78,7 +84,6 @@ namespace isc { namespace eval { /// Steal the contents of \a t. /// /// Close to move-semantics. - inline void push (T& t) { @@ -86,9 +91,8 @@ namespace isc { namespace eval { operator[](0).move (t); } - inline void - pop (unsigned int n = 1) + pop (unsigned n = 1) { for (; n; --n) seq_.pop_back (); @@ -100,21 +104,18 @@ namespace isc { namespace eval { seq_.clear (); } - inline typename S::size_type size () const { return seq_.size (); } - inline const_iterator begin () const { return seq_.rbegin (); } - inline const_iterator end () const { @@ -133,25 +134,24 @@ namespace isc { namespace eval { class slice { public: - slice (const S& stack, unsigned int range) + slice (const S& stack, unsigned range) : stack_ (stack) , range_ (range) {} - inline const T& - operator [] (unsigned int i) const + operator [] (unsigned i) const { return stack_[range_ - i]; } private: const S& stack_; - unsigned int range_; + unsigned range_; }; -#line 14 "parser.yy" // stack.hh:132 +#line 14 "parser.yy" // stack.hh:131 } } // isc::eval -#line 156 "stack.hh" // stack.hh:132 +#line 155 "stack.hh" // stack.hh:131 #endif // !YY_EVAL_STACK_HH_INCLUDED |