Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
01b370bd
Commit
01b370bd
authored
Nov 13, 2015
by
Francis Dupont
Browse files
[4088fd] cleanup grammar (indent, no untyped)
parent
b233a689
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/lib/eval/eval.dox
View file @
01b370bd
...
...
@@ -65,32 +65,34 @@
@code
01. %start expression;
02.
03. expression
:
04.
token EQUAL
token
05.
| token
;
03. expression
: token EQUAL token
04.
|
token
05.
;
06.
07. token:
08. STRING {
09. TokenPtr str(new TokenString($1));
10. ctx.expression.push_back(str);
11.}
12. HEXSTRING {
13. TokenPtr hex(new TokenHexString($1));
14. ctx.expression.push_back(hex);
15.}
16.| OPTION {
17. TokenPtr opt(new TokenOption($1));
18. ctx.expression.push_back(opt);
19.}
20.;
07. token : STRING
08. {
09. TokenPtr str(new TokenString($1));
10. ctx.expression.push_back(str);
11. }
12. | HEXSTRING
13. {
14. TokenPtr hex(new TokenHexString($1));
15. ctx.expression.push_back(hex);
16. }
17. | OPTION '[' INTEGER ']'
18. {
19. TokenPtr opt(new TokenOption($3));
20. ctx.expression.push_back(opt);
21. }
22. ;
@endcode
This code determines that the grammar starts from expression (line 1).
The actual definition of expression (lines 3-5) may either be a
single token or an expression "token == token" (EQUAL has been defined as
"==" elsewhere). Token is further
defined in lines 7-
15
: it may either be a string (lines
8
-11),
a hex string (lines 12-1
5
) or option (lines 1
6-19
).
defined in lines 7-
22
: it may either be a string (lines
7
-11),
a hex string (lines 12-1
6
) or option (lines 1
7-21
).
When the actual case is determined, the respective C++ action
is executed. For example, if the token is a string, the TokenString class is
instantiated with the appropriate value and put onto the expression vector.
...
...
src/lib/eval/lexer.cc
View file @
01b370bd
...
...
@@ -469,8 +469,8 @@ static void yy_fatal_error (yyconst char msg[] );
(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 1
8
#define YY_END_OF_BUFFER 1
9
#define YY_NUM_RULES 1
7
#define YY_END_OF_BUFFER 1
8
/* This struct is not used in this scanner,
but its presence is necessary. */
struct
yy_trans_info
...
...
@@ -478,14 +478,13 @@ struct yy_trans_info
flex_int32_t
yy_verify
;
flex_int32_t
yy_nxt
;
};
static
yyconst
flex_int16_t
yy_accept
[
56
]
=
static
yyconst
flex_int16_t
yy_accept
[
48
]
=
{
0
,
0
,
0
,
19
,
17
,
1
,
2
,
17
,
12
,
13
,
16
,
17
,
7
,
7
,
17
,
14
,
15
,
17
,
17
,
17
,
1
,
2
,
0
,
5
,
0
,
0
,
0
,
7
,
0
,
8
,
0
,
0
,
0
,
3
,
0
,
6
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
4
,
0
,
0
,
0
,
9
,
0
,
0
,
0
,
0
,
0
,
11
,
10
,
0
0
,
0
,
18
,
16
,
1
,
2
,
16
,
11
,
12
,
15
,
16
,
7
,
7
,
16
,
13
,
14
,
16
,
16
,
1
,
2
,
0
,
5
,
0
,
0
,
0
,
7
,
0
,
8
,
0
,
0
,
3
,
0
,
6
,
0
,
0
,
0
,
0
,
0
,
4
,
0
,
0
,
9
,
0
,
0
,
0
,
10
,
0
}
;
static
yyconst
flex_int32_t
yy_ec
[
256
]
=
...
...
@@ -495,15 +494,15 @@ static yyconst flex_int32_t yy_ec[256] =
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
4
,
5
,
6
,
1
,
1
,
7
,
8
,
1
,
1
,
9
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
1
1
,
1
,
1
,
1
2
,
1
,
1
,
1
,
1
3
,
1
3
,
1
3
,
1
3
,
1
3
,
1
3
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
1
,
1
,
1
,
1
1
,
1
,
1
,
1
,
1
2
,
1
2
,
1
2
,
1
2
,
1
2
,
1
2
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
4
,
1
,
1
,
1
5
,
1
,
1
6
,
1
,
1
,
1
,
1
7
,
1
8
,
1
3
,
1
9
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
3
,
1
,
1
,
1
4
,
1
,
1
5
,
1
,
1
,
1
,
1
6
,
1
7
,
1
2
,
1
2
,
2
0
,
1
3
,
2
1
,
1
,
22
,
1
,
1
,
2
3
,
1
,
2
4
,
2
5
,
2
6
,
1
,
2
7
,
2
8
,
2
9
,
30
,
1
,
1
,
1
4
,
3
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
2
,
1
2
,
1
8
,
1
,
19
,
1
,
1
,
2
0
,
1
,
2
1
,
2
2
,
2
3
,
1
,
2
4
,
2
5
,
2
6
,
27
,
1
,
1
,
1
3
,
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
,
...
...
@@ -520,72 +519,67 @@ static yyconst flex_int32_t yy_ec[256] =
1
,
1
,
1
,
1
,
1
}
;
static
yyconst
flex_int32_t
yy_meta
[
3
2
]
=
static
yyconst
flex_int32_t
yy_meta
[
2
8
]
=
{
0
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
3
,
3
,
1
,
1
,
3
,
1
,
1
,
1
,
3
,
3
,
3
,
3
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
1
,
3
,
1
,
1
,
1
,
3
,
3
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
}
;
static
yyconst
flex_int16_t
yy_base
[
5
8
]
=
static
yyconst
flex_int16_t
yy_base
[
5
0
]
=
{
0
,
0
,
0
,
86
,
87
,
83
,
81
,
28
,
87
,
87
,
87
,
24
,
30
,
32
,
71
,
87
,
87
,
56
,
51
,
56
,
77
,
75
,
73
,
87
,
39
,
42
,
31
,
46
,
0
,
87
,
47
,
57
,
45
,
87
,
43
,
0
,
51
,
44
,
40
,
66
,
43
,
36
,
38
,
87
,
39
,
35
,
41
,
87
,
38
,
40
,
34
,
46
,
32
,
87
,
87
,
87
,
66
,
47
0
,
0
,
75
,
76
,
72
,
70
,
24
,
76
,
76
,
76
,
20
,
26
,
28
,
61
,
76
,
76
,
48
,
43
,
66
,
62
,
60
,
76
,
37
,
39
,
38
,
35
,
0
,
76
,
37
,
45
,
76
,
46
,
0
,
42
,
35
,
55
,
35
,
30
,
76
,
34
,
30
,
76
,
34
,
31
,
33
,
76
,
76
,
66
,
28
}
;
static
yyconst
flex_int16_t
yy_def
[
5
8
]
=
static
yyconst
flex_int16_t
yy_def
[
5
0
]
=
{
0
,
55
,
1
,
55
,
55
,
55
,
55
,
56
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
56
,
55
,
56
,
56
,
56
,
55
,
57
,
55
,
55
,
55
,
55
,
55
,
56
,
57
,
55
,
55
,
55
,
56
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
0
,
55
,
55
47
,
1
,
47
,
47
,
47
,
47
,
48
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
48
,
47
,
48
,
48
,
48
,
47
,
49
,
47
,
47
,
47
,
47
,
48
,
49
,
47
,
47
,
48
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
0
,
47
,
47
}
;
static
yyconst
flex_int16_t
yy_nxt
[
1
19
]
=
static
yyconst
flex_int16_t
yy_nxt
[
1
04
]
=
{
0
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
4
,
14
,
4
,
4
,
15
,
16
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
17
,
4
,
4
,
18
,
4
,
19
,
4
,
23
,
27
,
27
,
23
,
24
,
25
,
25
,
27
,
27
,
27
,
27
,
23
,
28
,
26
,
33
,
23
,
25
,
25
,
35
,
25
,
25
,
54
,
34
,
27
,
27
,
53
,
52
,
51
,
50
,
49
,
48
,
47
,
46
,
45
,
39
,
22
,
44
,
22
,
43
,
42
,
41
,
40
,
38
,
37
,
36
,
23
,
21
,
20
,
32
,
31
,
30
,
29
,
21
,
20
,
55
,
3
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
14
,
4
,
4
,
15
,
16
,
4
,
4
,
4
,
4
,
4
,
4
,
17
,
4
,
4
,
18
,
4
,
4
,
22
,
26
,
26
,
33
,
23
,
24
,
24
,
26
,
26
,
26
,
26
,
27
,
25
,
22
,
22
,
31
,
26
,
26
,
24
,
24
,
24
,
24
,
22
,
46
,
45
,
44
,
43
,
42
,
41
,
40
,
32
,
39
,
38
,
37
,
35
,
34
,
22
,
20
,
36
,
21
,
19
,
21
,
30
,
29
,
28
,
20
,
19
,
47
,
3
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
}
;
static
yyconst
flex_int16_t
yy_chk
[
1
19
]
=
static
yyconst
flex_int16_t
yy_chk
[
1
04
]
=
{
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
,
7
,
11
,
11
,
26
,
7
,
7
,
7
,
12
,
12
,
13
,
13
,
24
,
12
,
7
,
25
,
34
,
24
,
24
,
57
,
25
,
25
,
52
,
26
,
27
,
27
,
51
,
50
,
49
,
48
,
46
,
45
,
44
,
42
,
41
,
34
,
56
,
40
,
56
,
39
,
38
,
37
,
36
,
32
,
31
,
30
,
22
,
21
,
20
,
19
,
18
,
17
,
14
,
6
,
5
,
3
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
,
55
1
,
1
,
1
,
1
,
1
,
1
,
1
,
7
,
11
,
11
,
49
,
7
,
7
,
7
,
12
,
12
,
13
,
13
,
12
,
7
,
23
,
25
,
24
,
26
,
26
,
23
,
23
,
24
,
24
,
32
,
45
,
44
,
43
,
41
,
40
,
38
,
37
,
25
,
36
,
35
,
34
,
30
,
29
,
21
,
20
,
32
,
48
,
19
,
48
,
18
,
17
,
14
,
6
,
5
,
3
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
,
47
}
;
/* Table of booleans, true if rule could match eol. */
static
yyconst
flex_int32_t
yy_rule_can_match_eol
[
1
9
]
=
static
yyconst
flex_int32_t
yy_rule_can_match_eol
[
1
8
]
=
{
0
,
0
,
1
,
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
,
};
static
yy_state_type
yy_last_accepting_state
;
static
char
*
yy_last_accepting_cpos
;
...
...
@@ -593,10 +587,10 @@ static char *yy_last_accepting_cpos;
extern
int
yy_flex_debug
;
int
yy_flex_debug
=
1
;
static
yyconst
flex_int16_t
yy_rule_linenum
[
1
8
]
=
static
yyconst
flex_int16_t
yy_rule_linenum
[
1
7
]
=
{
0
,
83
,
87
,
93
,
101
,
107
,
117
,
123
,
137
,
138
,
139
,
140
,
141
,
142
,
143
,
144
,
14
5
,
147
140
,
141
,
142
,
143
,
144
,
14
6
}
;
/* The intent behind this definition is that it'll catch
...
...
@@ -663,7 +657,7 @@ static isc::eval::location loc;
// by moving it ahead by yyleng bytes. yyleng specifies the length of the
// currently matched token.
#define YY_USER_ACTION loc.columns(yyleng);
#line 66
7
"lexer.cc"
#line 66
1
"lexer.cc"
#define INITIAL 0
...
...
@@ -946,7 +940,7 @@ YY_DECL
loc
.
step
();
#line 9
50
"lexer.cc"
#line 9
44
"lexer.cc"
while
(
1
)
/* loops until end-of-file is reached */
{
...
...
@@ -975,13 +969,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
>=
56
)
if
(
yy_current_state
>=
48
)
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
!=
55
);
while
(
yy_current_state
!=
47
);
yy_cp
=
(
yy_last_accepting_cpos
);
yy_current_state
=
(
yy_last_accepting_state
);
...
...
@@ -1010,13 +1004,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
<
1
8
)
else
if
(
yy_act
<
1
7
)
fprintf
(
stderr
,
"--accepting rule at line %ld (
\"
%s
\"
)
\n
"
,
(
long
)
yy_rule_linenum
[
yy_act
],
yytext
);
else
if
(
yy_act
==
1
8
)
else
if
(
yy_act
==
1
7
)
fprintf
(
stderr
,
"--accepting default rule (
\"
%s
\"
)
\n
"
,
yytext
);
else
if
(
yy_act
==
1
9
)
else
if
(
yy_act
==
1
8
)
fprintf
(
stderr
,
"--(end of buffer or a NUL)
\n
"
);
else
fprintf
(
stderr
,
"--EOF (start condition %d)
\n
"
,
YY_START
);
...
...
@@ -1127,48 +1121,43 @@ return isc::eval::EvalParser::make_SUBSTRING(loc);
case
11
:
YY_RULE_SETUP
#line 140 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_
UNTYPED
(
loc
);
return
isc
::
eval
::
EvalParser
::
make_
LPAREN
(
loc
);
YY_BREAK
case
12
:
YY_RULE_SETUP
#line 141 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_
L
PAREN
(
loc
);
return
isc
::
eval
::
EvalParser
::
make_
R
PAREN
(
loc
);
YY_BREAK
case
13
:
YY_RULE_SETUP
#line 142 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_
RPAREN
(
loc
);
return
isc
::
eval
::
EvalParser
::
make_
LBRACKET
(
loc
);
YY_BREAK
case
14
:
YY_RULE_SETUP
#line 143 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_
L
BRACKET
(
loc
);
return
isc
::
eval
::
EvalParser
::
make_
R
BRACKET
(
loc
);
YY_BREAK
case
15
:
YY_RULE_SETUP
#line 144 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_RBRACKET
(
loc
);
YY_BREAK
case
16
:
YY_RULE_SETUP
#line 145 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_COMA
(
loc
);
YY_BREAK
case
1
7
:
case
1
6
:
YY_RULE_SETUP
#line 14
7
"lexer.ll"
#line 14
6
"lexer.ll"
driver
.
error
(
loc
,
"Invalid character: "
+
std
::
string
(
yytext
));
YY_BREAK
case
YY_STATE_EOF
(
INITIAL
):
#line 14
8
"lexer.ll"
#line 14
7
"lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_END
(
loc
);
YY_BREAK
case
1
8
:
case
1
7
:
YY_RULE_SETUP
#line 14
9
"lexer.ll"
#line 14
8
"lexer.ll"
ECHO
;
YY_BREAK
#line 11
72
"lexer.cc"
#line 11
61
"lexer.cc"
case
YY_END_OF_BUFFER
:
{
...
...
@@ -1481,7 +1470,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
>=
56
)
if
(
yy_current_state
>=
48
)
yy_c
=
yy_meta
[(
unsigned
int
)
yy_c
];
}
yy_current_state
=
yy_nxt
[
yy_base
[
yy_current_state
]
+
(
unsigned
int
)
yy_c
];
...
...
@@ -1514,11 +1503,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
>=
56
)
if
(
yy_current_state
>=
48
)
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
==
55
);
yy_is_jam
=
(
yy_current_state
==
47
);
return
yy_is_jam
?
0
:
yy_current_state
;
}
...
...
@@ -2256,7 +2245,7 @@ void yyfree (void * ptr )
/* %ok-for-header */
#line 14
9
"lexer.ll"
#line 14
8
"lexer.ll"
...
...
src/lib/eval/lexer.ll
View file @
01b370bd
...
...
@@ -137,7 +137,6 @@ blank [ \t]
"=="
return
isc:
:
eval:
:
EvalParser:
:make_EQUAL
(
loc
)
;
"option"
return
isc:
:
eval:
:
EvalParser:
:make_OPTION
(
loc
)
;
"substring"
return
isc:
:
eval:
:
EvalParser:
:make_SUBSTRING
(
loc
)
;
"untyped:"
return
isc:
:
eval:
:
EvalParser:
:make_UNTYPED
(
loc
)
;
"("
return
isc:
:
eval:
:
EvalParser:
:make_LPAREN
(
loc
)
;
")"
return
isc:
:
eval:
:
EvalParser:
:make_RPAREN
(
loc
)
;
"["
return
isc:
:
eval:
:
EvalParser:
:make_LBRACKET
(
loc
)
;
...
...
src/lib/eval/parser.cc
View file @
01b370bd
...
...
@@ -251,14 +251,14 @@ namespace isc { namespace eval {
{
switch
(
that
.
type_get
())
{
case
1
6
:
// "integer"
case
1
5
:
// "integer"
value
.
move
<
int
>
(
that
.
value
);
break
;
case
1
2
:
// "a number in a constant string"
case
1
3
:
// "the all constant string"
case
1
4
:
// "constant string"
case
1
5
:
// "constant hexstring"
case
1
1
:
// "a number in a constant string"
case
1
2
:
// "the all constant string"
case
1
3
:
// "constant string"
case
1
4
:
// "constant hexstring"
value
.
move
<
std
::
string
>
(
that
.
value
);
break
;
...
...
@@ -277,14 +277,14 @@ namespace isc { namespace eval {
state
=
that
.
state
;
switch
(
that
.
type_get
())
{
case
1
6
:
// "integer"
case
1
5
:
// "integer"
value
.
copy
<
int
>
(
that
.
value
);
break
;
case
1
2
:
// "a number in a constant string"
case
1
3
:
// "the all constant string"
case
1
4
:
// "constant string"
case
1
5
:
// "constant hexstring"
case
1
1
:
// "a number in a constant string"
case
1
2
:
// "the all constant string"
case
1
3
:
// "constant string"
case
1
4
:
// "constant hexstring"
value
.
copy
<
std
::
string
>
(
that
.
value
);
break
;
...
...
@@ -324,37 +324,37 @@ namespace isc { namespace eval {
<<
yysym
.
location
<<
": "
;
switch
(
yytype
)
{
case
1
2
:
// "a number in a constant string"
case
1
1
:
// "a number in a constant string"
#line 5
9
"parser.yy" // lalr1.cc:636
#line 5
8
"parser.yy" // lalr1.cc:636
{
yyoutput
<<
yysym
.
value
.
template
as
<
std
::
string
>
();
}
#line 332 "parser.cc" // lalr1.cc:636
break
;
case
1
3
:
// "the all constant string"
case
1
2
:
// "the all constant string"
#line 5
9
"parser.yy" // lalr1.cc:636
#line 5
8
"parser.yy" // lalr1.cc:636
{
yyoutput
<<
yysym
.
value
.
template
as
<
std
::
string
>
();
}
#line 339 "parser.cc" // lalr1.cc:636
break
;
case
1
4
:
// "constant string"
case
1
3
:
// "constant string"
#line 5
9
"parser.yy" // lalr1.cc:636
#line 5
8
"parser.yy" // lalr1.cc:636
{
yyoutput
<<
yysym
.
value
.
template
as
<
std
::
string
>
();
}
#line 346 "parser.cc" // lalr1.cc:636
break
;
case
1
5
:
// "constant hexstring"
case
1
4
:
// "constant hexstring"
#line 5
9
"parser.yy" // lalr1.cc:636
#line 5
8
"parser.yy" // lalr1.cc:636
{
yyoutput
<<
yysym
.
value
.
template
as
<
std
::
string
>
();
}
#line 353 "parser.cc" // lalr1.cc:636
break
;
case
1
6
:
// "integer"
case
1
5
:
// "integer"
#line 5
9
"parser.yy" // lalr1.cc:636
#line 5
8
"parser.yy" // lalr1.cc:636
{
yyoutput
<<
yysym
.
value
.
template
as
<
int
>
();
}
#line 360 "parser.cc" // lalr1.cc:636
break
;
...
...
@@ -556,14 +556,14 @@ namespace isc { namespace eval {
when using variants. */
switch
(
yyr1_
[
yyn
])
{
case
1
6
:
// "integer"
case
1
5
:
// "integer"
yylhs
.
value
.
build
<
int
>
();
break
;
case
1
2
:
// "a number in a constant string"
case
1
3
:
// "the all constant string"
case
1
4
:
// "constant string"
case
1
5
:
// "constant hexstring"
case
1
1
:
// "a number in a constant string"
case
1
2
:
// "the all constant string"
case
1
3
:
// "constant string"
case
1
4
:
// "constant hexstring"
yylhs
.
value
.
build
<
std
::
string
>
();
break
;
...
...
@@ -584,175 +584,105 @@ namespace isc { namespace eval {
{
switch
(
yyn
)
{
case
4
:
#line 7
3
"parser.yy" // lalr1.cc:859
case
3
:
#line 7
0
"parser.yy" // lalr1.cc:859
{
TokenPtr
eq
(
new
TokenEqual
());
ctx
.
expression
.
push_back
(
eq
);
}
TokenPtr
eq
(
new
TokenEqual
());
ctx
.
expression
.
push_back
(
eq
);
}
#line 594 "parser.cc" // lalr1.cc:859
break
;
case
6
:
#line
81
"parser.yy" // lalr1.cc:859
case
4
:
#line
77
"parser.yy" // lalr1.cc:859
{
TokenPtr
str
(
new
TokenString
(
yystack_
[
0
].
value
.
as
<
std
::
string
>
()));
ctx
.
expression
.
push_back
(
str
);
}
TokenPtr
str
(
new
TokenString
(
yystack_
[
0
].
value
.
as
<
std
::
string
>
()));
ctx
.
expression
.
push_back
(
str
);
}
#line 603 "parser.cc" // lalr1.cc:859
break
;
case
7
:
#line 8
5
"parser.yy" // lalr1.cc:859
case
5
:
#line 8
2
"parser.yy" // lalr1.cc:859
{
TokenPtr
str
(
new
TokenString
(
yystack_
[
0
].
value
.
as
<
std
::
string
>
()));
ctx
.
expression
.
push_back
(
str
);
}
TokenPtr
str
(
new
TokenString
(
yystack_
[
0
].
value
.
as
<
std
::
string
>
()));
ctx
.
expression
.
push_back
(
str
);
}
#line 612 "parser.cc" // lalr1.cc:859
break
;
case
8
:
#line 8
9
"parser.yy" // lalr1.cc:859
case
6
:
#line 8
7
"parser.yy" // lalr1.cc:859
{
TokenPtr
str
(
new
TokenString
(
"all"
));
ctx
.
expression
.
push_back
(
str
);
}
TokenPtr
str
(
new
TokenString
(
"all"
));
ctx
.
expression
.
push_back
(
str
);
}
#line 621 "parser.cc" // lalr1.cc:859
break
;
case
9
:
#line 9
3
"parser.yy" // lalr1.cc:859
case
7
:
#line 9
2
"parser.yy" // lalr1.cc:859
{
TokenPtr
hex
(
new
TokenHexString
(
yystack_
[
0
].
value
.
as
<
std
::
string
>
()));
ctx
.
expression
.
push_back
(
hex
);
}
TokenPtr
hex
(
new
TokenHexString
(
yystack_
[
0
].
value
.
as
<
std
::
string
>
()));
ctx
.
expression
.
push_back
(
hex
);
}
#line 630 "parser.cc" // lalr1.cc:859
break
;
case
10
:
case
8
:
#line 97 "parser.yy" // lalr1.cc:859
{
int
n
=
yystack_
[
1
].
value
.
as
<
int
>
();
if
(
n
<
0
||
n
>
65535
)
{
std
::
ostringstream
oss
;
oss
<<
"Option code has invalid value in "
<<
n
<<
". Allowed range: 0..65535"
;
ctx
.
error
(
yystack_
[
1
].
location
,
oss
.
str
());
}
TokenPtr
opt
(
new
TokenOption
(
static_cast
<
uint16_t
>
(
n
)));
ctx
.
expression
.
push_back
(
opt
);
}
int
n
=
yystack_
[
1
].
value
.
as
<
int
>
();
if
(
n
<
0
||
n
>
65535
)
{
std
::
ostringstream
oss
;
oss
<<
"Option code has invalid value in "
<<
n
<<
". Allowed range: 0..65535"
;
ctx
.
error
(
yystack_
[
1
].
location
,
oss
.
str
());
}
TokenPtr
opt
(
new
TokenOption
(
static_cast
<
uint16_t
>
(
n
)));
ctx
.
expression
.
push_back
(
opt
);
}
#line 646 "parser.cc" // lalr1.cc:859
break
;
case
11
:
#line 10
8
"parser.yy" // lalr1.cc:859
case
9
:
#line 10
9
"parser.yy" // lalr1.cc:859
{
TokenPtr
sub
(
new
TokenSubstring
());
ctx
.
expression
.
push_back
(
sub
);
}
TokenPtr
sub
(
new