Config: Implement << and >> operators.

This commit is contained in:
Gunnar Beutner 2013-06-26 08:21:35 +02:00
parent 49faf14b70
commit 8302062ead
5 changed files with 486 additions and 424 deletions

View File

@ -370,8 +370,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 58
#define YY_END_OF_BUFFER 59
#define YY_NUM_RULES 60
#define YY_END_OF_BUFFER 61
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@ -379,29 +379,29 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[196] =
static yyconst flex_int16_t yy_accept[199] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 59, 57,
21, 21, 1, 57, 57, 57, 57, 57, 51, 57,
52, 45, 45, 45, 45, 45, 45, 45, 45, 45,
45, 45, 57, 18, 19, 12, 3, 2, 58, 15,
15, 0, 0, 0, 55, 53, 51, 54, 16, 20,
56, 0, 48, 49, 50, 0, 46, 45, 45, 45,
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
45, 45, 45, 45, 45, 45, 0, 17, 12, 11,
4, 5, 9, 10, 6, 8, 7, 0, 0, 0,
0, 20, 51, 47, 45, 28, 45, 45, 45, 45,
0, 0, 0, 0, 0, 0, 0, 0, 61, 59,
21, 21, 1, 59, 59, 59, 59, 59, 53, 59,
54, 59, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 59, 18, 19, 12, 3, 2, 60,
15, 15, 0, 0, 0, 57, 55, 53, 56, 16,
20, 58, 0, 50, 51, 52, 0, 45, 48, 46,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 0,
17, 12, 11, 4, 5, 9, 10, 6, 8, 7,
0, 0, 0, 0, 20, 53, 49, 47, 28, 47,
45, 45, 45, 45, 45, 45, 45, 45, 45, 44,
45, 45, 45, 45, 13, 4, 5, 14, 0, 0,
0, 45, 45, 45, 45, 45, 45, 45, 45, 29,
40, 45, 45, 45, 45, 45, 45, 42, 22, 4,
0, 0, 0, 45, 24, 45, 43, 45, 45, 45,
34, 45, 45, 45, 45, 45, 45, 0, 0, 0,
45, 45, 45, 45, 45, 25, 35, 45, 27, 26,
45, 0, 0, 0, 45, 45, 37, 45, 38, 41,
45, 0, 31, 0, 33, 45, 39, 36, 0, 0,
45, 32, 30, 23, 0
47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
47, 47, 44, 47, 47, 47, 47, 13, 4, 5,
14, 0, 0, 0, 47, 47, 47, 47, 47, 47,
47, 47, 29, 40, 47, 47, 47, 47, 47, 47,
42, 22, 4, 0, 0, 0, 47, 24, 47, 43,
47, 47, 47, 34, 47, 47, 47, 47, 47, 47,
0, 0, 0, 47, 47, 47, 47, 47, 25, 35,
47, 27, 26, 47, 0, 0, 0, 47, 47, 37,
47, 38, 41, 47, 0, 31, 0, 33, 47, 39,
36, 0, 0, 47, 32, 30, 23, 0
} ;
@ -446,140 +446,141 @@ static yyconst flex_int32_t yy_meta[43] =
1, 1
} ;
static yyconst flex_int16_t yy_base[204] =
static yyconst flex_int16_t yy_base[207] =
{ 0,
0, 0, 244, 243, 40, 42, 206, 205, 246, 251,
251, 251, 251, 28, 230, 229, 37, 44, 44, 227,
251, 0, 31, 215, 222, 209, 37, 38, 219, 219,
50, 42, 196, 251, 226, 0, 251, 251, 77, 251,
193, 197, 210, 213, 251, 251, 74, 251, 251, 0,
251, 67, 251, 195, 251, 214, 251, 0, 193, 188,
192, 205, 196, 69, 204, 202, 192, 62, 193, 185,
200, 181, 182, 186, 177, 181, 172, 251, 0, 251,
82, 87, 251, 251, 251, 251, 251, 170, 174, 176,
180, 0, 91, 251, 171, 0, 188, 169, 169, 175,
0, 0, 247, 246, 40, 42, 209, 208, 249, 254,
254, 254, 254, 28, 233, 232, 37, 44, 44, 48,
254, 230, 0, 37, 218, 225, 212, 34, 46, 222,
222, 48, 52, 199, 254, 229, 0, 254, 254, 82,
254, 196, 200, 213, 216, 254, 254, 79, 254, 254,
0, 254, 65, 254, 198, 254, 217, 216, 254, 254,
0, 195, 190, 194, 207, 198, 52, 206, 204, 194,
52, 195, 187, 202, 183, 184, 188, 179, 183, 174,
254, 0, 254, 84, 86, 254, 254, 254, 254, 254,
172, 176, 178, 182, 0, 88, 254, 173, 0, 190,
180, 167, 182, 177, 170, 178, 174, 159, 166, 0,
167, 160, 169, 168, 251, 94, 104, 251, 155, 151,
161, 152, 146, 158, 161, 145, 147, 162, 151, 0,
0, 156, 157, 150, 157, 144, 145, 0, 0, 107,
146, 145, 149, 151, 0, 137, 0, 146, 140, 131,
0, 130, 127, 144, 127, 136, 141, 139, 123, 138,
135, 122, 123, 108, 86, 0, 0, 96, 0, 0,
87, 85, 99, 83, 76, 92, 0, 73, 0, 0,
84, 59, 251, 52, 0, 46, 0, 0, 52, 37,
28, 251, 251, 0, 251, 127, 131, 135, 139, 57,
171, 171, 177, 182, 169, 184, 179, 172, 180, 176,
161, 168, 0, 169, 162, 171, 170, 254, 92, 96,
254, 157, 153, 163, 154, 148, 160, 163, 147, 149,
164, 153, 0, 0, 158, 159, 152, 159, 146, 147,
0, 0, 99, 148, 147, 151, 153, 0, 139, 0,
148, 142, 133, 0, 132, 129, 146, 129, 138, 143,
141, 125, 140, 137, 126, 133, 118, 114, 0, 0,
124, 0, 0, 113, 105, 119, 86, 85, 102, 0,
84, 0, 0, 93, 75, 254, 69, 0, 54, 0,
0, 63, 48, 39, 254, 254, 0, 254, 124, 128,
143, 147, 151
132, 136, 47, 140, 144, 148
} ;
static yyconst flex_int16_t yy_def[204] =
static yyconst flex_int16_t yy_def[207] =
{ 0,
195, 1, 196, 196, 197, 197, 198, 198, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 199,
195, 200, 200, 200, 200, 200, 200, 200, 200, 200,
200, 200, 195, 195, 195, 201, 195, 195, 202, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 203,
195, 195, 195, 195, 195, 199, 195, 200, 200, 200,
200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
200, 200, 200, 200, 200, 200, 195, 195, 201, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 203, 195, 195, 200, 200, 200, 200, 200, 200,
198, 1, 199, 199, 200, 200, 201, 201, 198, 198,
198, 198, 198, 198, 198, 198, 198, 198, 198, 202,
198, 198, 203, 203, 203, 203, 203, 203, 203, 203,
203, 203, 203, 198, 198, 198, 204, 198, 198, 205,
198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
206, 198, 198, 198, 198, 198, 202, 202, 198, 198,
203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
203, 203, 203, 203, 203, 203, 203, 203, 203, 198,
198, 204, 198, 198, 198, 198, 198, 198, 198, 198,
198, 198, 198, 198, 206, 198, 198, 203, 203, 203,
200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
200, 200, 200, 200, 195, 195, 195, 195, 195, 195,
195, 200, 200, 200, 200, 200, 200, 200, 200, 200,
200, 200, 200, 200, 200, 200, 200, 200, 200, 195,
195, 195, 195, 200, 200, 200, 200, 200, 200, 200,
200, 200, 200, 200, 200, 200, 200, 195, 195, 195,
200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
200, 195, 195, 195, 200, 200, 200, 200, 200, 200,
200, 195, 195, 195, 200, 200, 200, 200, 195, 195,
200, 195, 195, 200, 0, 195, 195, 195, 195, 195,
203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
203, 203, 203, 203, 203, 203, 203, 198, 198, 198,
198, 198, 198, 198, 203, 203, 203, 203, 203, 203,
203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
203, 203, 198, 198, 198, 198, 203, 203, 203, 203,
203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
198, 198, 198, 203, 203, 203, 203, 203, 203, 203,
203, 203, 203, 203, 198, 198, 198, 203, 203, 203,
203, 203, 203, 203, 198, 198, 198, 203, 203, 203,
203, 198, 198, 203, 198, 198, 203, 0, 198, 198,
195, 195, 195
198, 198, 198, 198, 198, 198
} ;
static yyconst flex_int16_t yy_nxt[294] =
static yyconst flex_int16_t yy_nxt[297] =
{ 0,
10, 11, 12, 13, 14, 15, 16, 17, 10, 18,
19, 19, 10, 20, 21, 10, 22, 10, 23, 22,
22, 24, 22, 25, 22, 22, 26, 22, 27, 22,
28, 29, 30, 22, 22, 31, 32, 22, 22, 22,
33, 10, 37, 38, 37, 38, 42, 47, 47, 49,
59, 48, 52, 50, 47, 47, 67, 39, 51, 39,
58, 60, 43, 65, 74, 61, 44, 194, 66, 53,
71, 193, 72, 54, 192, 68, 75, 93, 93, 55,
191, 76, 52, 190, 47, 47, 73, 81, 82, 100,
105, 106, 116, 117, 101, 189, 83, 117, 117, 53,
19, 19, 10, 20, 21, 22, 23, 10, 24, 23,
23, 25, 23, 26, 23, 23, 27, 23, 28, 23,
29, 30, 31, 23, 23, 32, 33, 23, 23, 23,
34, 10, 38, 39, 38, 39, 43, 48, 48, 50,
61, 49, 53, 51, 48, 48, 62, 40, 52, 40,
68, 58, 44, 59, 70, 69, 45, 63, 74, 54,
75, 64, 103, 55, 77, 96, 96, 104, 197, 56,
108, 109, 196, 71, 76, 195, 78, 53, 194, 48,
48, 79, 84, 85, 119, 120, 120, 120, 96, 96,
84, 93, 93, 54, 140, 117, 188, 85, 187, 55,
186, 86, 185, 87, 117, 117, 53, 117, 117, 184,
54, 183, 182, 181, 180, 179, 55, 34, 34, 34,
34, 36, 36, 36, 36, 40, 40, 40, 40, 56,
56, 56, 56, 79, 178, 177, 79, 80, 80, 80,
80, 92, 176, 92, 92, 175, 174, 173, 172, 171,
170, 169, 168, 167, 166, 165, 164, 163, 162, 161,
160, 159, 158, 157, 156, 155, 154, 153, 152, 151,
150, 149, 148, 147, 146, 145, 144, 143, 142, 141,
139, 138, 137, 136, 135, 134, 133, 132, 131, 130,
193, 86, 143, 120, 54, 87, 120, 120, 55, 120,
120, 192, 88, 54, 56, 191, 89, 55, 90, 190,
189, 188, 187, 56, 35, 35, 35, 35, 37, 37,
37, 37, 41, 41, 41, 41, 57, 57, 57, 57,
82, 186, 185, 82, 83, 83, 83, 83, 95, 184,
95, 95, 183, 182, 181, 180, 179, 178, 177, 176,
175, 174, 173, 172, 171, 170, 169, 168, 167, 166,
165, 164, 163, 162, 161, 160, 159, 158, 157, 156,
155, 154, 153, 152, 151, 150, 149, 148, 147, 146,
145, 144, 142, 141, 140, 139, 138, 137, 136, 135,
129, 128, 127, 126, 125, 124, 123, 122, 121, 120,
119, 118, 115, 114, 113, 112, 111, 110, 109, 108,
107, 104, 103, 102, 99, 98, 97, 96, 95, 57,
94, 91, 90, 89, 88, 78, 77, 70, 69, 64,
63, 62, 57, 46, 45, 195, 41, 41, 35, 35,
9, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195
134, 133, 132, 131, 130, 129, 128, 127, 126, 125,
124, 123, 122, 121, 118, 117, 116, 115, 114, 113,
112, 111, 110, 107, 106, 105, 102, 101, 100, 99,
98, 59, 59, 97, 94, 93, 92, 91, 81, 80,
73, 72, 67, 66, 65, 60, 47, 46, 198, 42,
42, 36, 36, 9, 198, 198, 198, 198, 198, 198,
198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
198, 198, 198, 198, 198, 198
} ;
static yyconst flex_int16_t yy_chk[294] =
static yyconst flex_int16_t yy_chk[297] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 5, 5, 6, 6, 14, 17, 17, 18,
23, 17, 19, 18, 19, 19, 28, 5, 18, 6,
200, 23, 14, 27, 32, 23, 14, 191, 27, 19,
31, 190, 31, 19, 189, 28, 32, 52, 52, 19,
186, 32, 47, 184, 47, 47, 31, 39, 39, 64,
68, 68, 81, 81, 64, 182, 39, 82, 82, 47,
203, 17, 19, 18, 19, 19, 24, 5, 18, 6,
28, 20, 14, 20, 29, 28, 14, 24, 32, 19,
32, 24, 67, 19, 33, 53, 53, 67, 194, 19,
71, 71, 193, 29, 32, 192, 33, 48, 189, 48,
48, 33, 40, 40, 84, 84, 85, 85, 96, 96,
39, 93, 93, 47, 116, 116, 181, 39, 178, 47,
176, 39, 175, 39, 117, 117, 93, 140, 140, 174,
93, 173, 172, 171, 168, 165, 93, 196, 196, 196,
196, 197, 197, 197, 197, 198, 198, 198, 198, 199,
199, 199, 199, 201, 164, 163, 201, 202, 202, 202,
202, 203, 162, 203, 203, 161, 160, 159, 158, 157,
156, 155, 154, 153, 152, 150, 149, 148, 146, 144,
143, 142, 141, 137, 136, 135, 134, 133, 132, 129,
128, 127, 126, 125, 124, 123, 122, 121, 120, 119,
114, 113, 112, 111, 109, 108, 107, 106, 105, 104,
187, 40, 119, 119, 48, 40, 120, 120, 48, 143,
143, 185, 40, 96, 48, 184, 40, 96, 40, 181,
179, 178, 177, 96, 199, 199, 199, 199, 200, 200,
200, 200, 201, 201, 201, 201, 202, 202, 202, 202,
204, 176, 175, 204, 205, 205, 205, 205, 206, 174,
206, 206, 171, 168, 167, 166, 165, 164, 163, 162,
161, 160, 159, 158, 157, 156, 155, 153, 152, 151,
149, 147, 146, 145, 144, 140, 139, 138, 137, 136,
135, 132, 131, 130, 129, 128, 127, 126, 125, 124,
123, 122, 117, 116, 115, 114, 112, 111, 110, 109,
103, 102, 101, 100, 99, 98, 97, 95, 91, 90,
89, 88, 77, 76, 75, 74, 73, 72, 71, 70,
69, 67, 66, 65, 63, 62, 61, 60, 59, 56,
54, 44, 43, 42, 41, 35, 33, 30, 29, 26,
25, 24, 20, 16, 15, 9, 8, 7, 4, 3,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195
108, 107, 106, 105, 104, 103, 102, 101, 100, 98,
94, 93, 92, 91, 80, 79, 78, 77, 76, 75,
74, 73, 72, 70, 69, 68, 66, 65, 64, 63,
62, 58, 57, 55, 45, 44, 43, 42, 36, 34,
31, 30, 27, 26, 25, 22, 16, 15, 9, 8,
7, 4, 3, 198, 198, 198, 198, 198, 198, 198,
198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
198, 198, 198, 198, 198, 198
} ;
/* Table of booleans, true if rule could match eol. */
static yyconst flex_int32_t yy_rule_can_match_eol[59] =
static yyconst flex_int32_t yy_rule_can_match_eol[61] =
{ 0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, };
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@ -683,7 +684,7 @@ static char *lb_steal(lex_buf *lb)
#line 687 "../../../lib/config/config_lexer.cc"
#line 688 "../../../lib/config/config_lexer.cc"
#define INITIAL 0
#define C_COMMENT 1
@ -940,7 +941,7 @@ YY_DECL
lex_buf string_buf;
#line 944 "../../../lib/config/config_lexer.cc"
#line 945 "../../../lib/config/config_lexer.cc"
yylval = yylval_param;
@ -997,13 +998,13 @@ 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 >= 196 )
if ( yy_current_state >= 199 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_current_state != 195 );
while ( yy_current_state != 198 );
yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state;
@ -1315,76 +1316,86 @@ return T_SET;
case 45:
YY_RULE_SETUP
#line 213 "config_lexer.ll"
{ yylval->text = strdup(yytext); return T_IDENTIFIER; }
return T_SHIFT_LEFT;
YY_BREAK
case 46:
/* rule 46 can match eol */
YY_RULE_SETUP
#line 214 "config_lexer.ll"
{ yytext[yyleng-1] = '\0'; yylval->text = strdup(yytext + 1); return T_STRING_ANGLE; }
return T_SHIFT_RIGHT;
YY_BREAK
case 47:
YY_RULE_SETUP
#line 215 "config_lexer.ll"
{ yylval->num = strtod(yytext, NULL) / 1000; return T_NUMBER; }
{ yylval->text = strdup(yytext); return T_IDENTIFIER; }
YY_BREAK
case 48:
/* rule 48 can match eol */
YY_RULE_SETUP
#line 216 "config_lexer.ll"
{ yylval->num = strtod(yytext, NULL) * 60 * 60; return T_NUMBER; }
{ yytext[yyleng-1] = '\0'; yylval->text = strdup(yytext + 1); return T_STRING_ANGLE; }
YY_BREAK
case 49:
YY_RULE_SETUP
#line 217 "config_lexer.ll"
{ yylval->num = strtod(yytext, NULL) * 60; return T_NUMBER; }
{ yylval->num = strtod(yytext, NULL) / 1000; return T_NUMBER; }
YY_BREAK
case 50:
YY_RULE_SETUP
#line 218 "config_lexer.ll"
{ yylval->num = strtod(yytext, NULL); return T_NUMBER; }
{ yylval->num = strtod(yytext, NULL) * 60 * 60; return T_NUMBER; }
YY_BREAK
case 51:
YY_RULE_SETUP
#line 219 "config_lexer.ll"
{ yylval->num = strtod(yytext, NULL); return T_NUMBER; }
{ yylval->num = strtod(yytext, NULL) * 60; return T_NUMBER; }
YY_BREAK
case 52:
YY_RULE_SETUP
#line 220 "config_lexer.ll"
{ yylval->op = OperatorSet; return T_EQUAL; }
{ yylval->num = strtod(yytext, NULL); return T_NUMBER; }
YY_BREAK
case 53:
YY_RULE_SETUP
#line 221 "config_lexer.ll"
{ yylval->op = OperatorPlus; return T_PLUS_EQUAL; }
{ yylval->num = strtod(yytext, NULL); return T_NUMBER; }
YY_BREAK
case 54:
YY_RULE_SETUP
#line 222 "config_lexer.ll"
{ yylval->op = OperatorMinus; return T_MINUS_EQUAL; }
{ yylval->op = OperatorSet; return T_EQUAL; }
YY_BREAK
case 55:
YY_RULE_SETUP
#line 223 "config_lexer.ll"
{ yylval->op = OperatorMultiply; return T_MULTIPLY_EQUAL; }
{ yylval->op = OperatorPlus; return T_PLUS_EQUAL; }
YY_BREAK
case 56:
YY_RULE_SETUP
#line 224 "config_lexer.ll"
{ yylval->op = OperatorDivide; return T_DIVIDE_EQUAL; }
{ yylval->op = OperatorMinus; return T_MINUS_EQUAL; }
YY_BREAK
case 57:
YY_RULE_SETUP
#line 227 "config_lexer.ll"
return yytext[0];
#line 225 "config_lexer.ll"
{ yylval->op = OperatorMultiply; return T_MULTIPLY_EQUAL; }
YY_BREAK
case 58:
YY_RULE_SETUP
#line 226 "config_lexer.ll"
{ yylval->op = OperatorDivide; return T_DIVIDE_EQUAL; }
YY_BREAK
case 59:
YY_RULE_SETUP
#line 229 "config_lexer.ll"
return yytext[0];
YY_BREAK
case 60:
YY_RULE_SETUP
#line 231 "config_lexer.ll"
ECHO;
YY_BREAK
#line 1388 "../../../lib/config/config_lexer.cc"
#line 1399 "../../../lib/config/config_lexer.cc"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(C_COMMENT):
case YY_STATE_EOF(STRING):
@ -1682,7 +1693,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
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 >= 196 )
if ( yy_current_state >= 199 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@ -1711,11 +1722,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
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 >= 196 )
if ( yy_current_state >= 199 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 195);
yy_is_jam = (yy_current_state == 198);
return yy_is_jam ? 0 : yy_current_state;
}
@ -2574,7 +2585,7 @@ void yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
#line 229 "config_lexer.ll"
#line 231 "config_lexer.ll"

View File

@ -210,6 +210,8 @@ partial return T_PARTIAL;
true { yylval->num = 1; return T_NUMBER; }
false { yylval->num = 0; return T_NUMBER; }
set return T_SET;
\<\< return T_SHIFT_LEFT;
\>\> return T_SHIFT_RIGHT;
[a-zA-Z_][:a-zA-Z0-9\-_]* { yylval->text = strdup(yytext); return T_IDENTIFIER; }
\<[^\>]*\> { yytext[yyleng-1] = '\0'; yylval->text = strdup(yytext + 1); return T_STRING_ANGLE; }
-?[0-9]+(\.[0-9]+)?ms { yylval->num = strtod(yytext, NULL) / 1000; return T_NUMBER; }

File diff suppressed because it is too large Load Diff

View File

@ -99,25 +99,27 @@ using namespace icinga;
T_MULTIPLY_EQUAL = 266,
T_DIVIDE_EQUAL = 267,
T_SET = 268,
T_TYPE_DICTIONARY = 269,
T_TYPE_ARRAY = 270,
T_TYPE_NUMBER = 271,
T_TYPE_STRING = 272,
T_TYPE_SCALAR = 273,
T_TYPE_ANY = 274,
T_TYPE_NAME = 275,
T_VALIDATOR = 276,
T_REQUIRE = 277,
T_ATTRIBUTE = 278,
T_TYPE = 279,
T_ABSTRACT = 280,
T_LOCAL = 281,
T_OBJECT = 282,
T_TEMPLATE = 283,
T_INCLUDE = 284,
T_LIBRARY = 285,
T_INHERITS = 286,
T_PARTIAL = 287
T_SHIFT_LEFT = 269,
T_SHIFT_RIGHT = 270,
T_TYPE_DICTIONARY = 271,
T_TYPE_ARRAY = 272,
T_TYPE_NUMBER = 273,
T_TYPE_STRING = 274,
T_TYPE_SCALAR = 275,
T_TYPE_ANY = 276,
T_TYPE_NAME = 277,
T_VALIDATOR = 278,
T_REQUIRE = 279,
T_ATTRIBUTE = 280,
T_TYPE = 281,
T_ABSTRACT = 282,
T_LOCAL = 283,
T_OBJECT = 284,
T_TEMPLATE = 285,
T_INCLUDE = 286,
T_LIBRARY = 287,
T_INHERITS = 288,
T_PARTIAL = 289
};
#endif
/* Tokens. */
@ -132,25 +134,27 @@ using namespace icinga;
#define T_MULTIPLY_EQUAL 266
#define T_DIVIDE_EQUAL 267
#define T_SET 268
#define T_TYPE_DICTIONARY 269
#define T_TYPE_ARRAY 270
#define T_TYPE_NUMBER 271
#define T_TYPE_STRING 272
#define T_TYPE_SCALAR 273
#define T_TYPE_ANY 274
#define T_TYPE_NAME 275
#define T_VALIDATOR 276
#define T_REQUIRE 277
#define T_ATTRIBUTE 278
#define T_TYPE 279
#define T_ABSTRACT 280
#define T_LOCAL 281
#define T_OBJECT 282
#define T_TEMPLATE 283
#define T_INCLUDE 284
#define T_LIBRARY 285
#define T_INHERITS 286
#define T_PARTIAL 287
#define T_SHIFT_LEFT 269
#define T_SHIFT_RIGHT 270
#define T_TYPE_DICTIONARY 271
#define T_TYPE_ARRAY 272
#define T_TYPE_NUMBER 273
#define T_TYPE_STRING 274
#define T_TYPE_SCALAR 275
#define T_TYPE_ANY 276
#define T_TYPE_NAME 277
#define T_VALIDATOR 278
#define T_REQUIRE 279
#define T_ATTRIBUTE 280
#define T_TYPE 281
#define T_ABSTRACT 282
#define T_LOCAL 283
#define T_OBJECT 284
#define T_TEMPLATE 285
#define T_INCLUDE 286
#define T_LIBRARY 287
#define T_INHERITS 288
#define T_PARTIAL 289
@ -175,7 +179,7 @@ typedef union YYSTYPE
/* Line 2068 of yacc.c */
#line 179 "../../../lib/config/config_parser.h"
#line 183 "../../../lib/config/config_parser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */

View File

@ -74,6 +74,8 @@ using namespace icinga;
%token <op> T_MULTIPLY_EQUAL "*= (T_MULTIPLY_EQUAL)"
%token <op> T_DIVIDE_EQUAL "/= (T_DIVIDE_EQUAL)"
%token T_SET "set (T_SET)"
%token T_SHIFT_LEFT "<< (T_SHIFT_LEFT)"
%token T_SHIFT_RIGHT ">> (T_SHIFT_RIGHT)"
%token <type> T_TYPE_DICTIONARY "dictionary (T_TYPE_DICTIONARY)"
%token <type> T_TYPE_ARRAY "array (T_TYPE_ARRAY)"
%token <type> T_TYPE_NUMBER "number (T_TYPE_NUMBER)"
@ -582,6 +584,14 @@ constexpression: T_NUMBER
{
$$ = (long)$1 | (long)$3;
}
| constexpression T_SHIFT_LEFT constexpression
{
$$ = (long)$1 << (long)$3;
}
| constexpression T_SHIFT_RIGHT constexpression
{
$$ = (long)$1 >> (long)$3;
}
| '(' constexpression ')'
{
$$ = $2;