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
751b714c
Commit
751b714c
authored
Nov 13, 2015
by
Francis Dupont
Browse files
[4088fd] Changed the syntax to unquote integers
parent
f2021d66
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/lib/eval/lexer.cc
View file @
751b714c
...
...
@@ -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
7
#define YY_END_OF_BUFFER 1
8
#define YY_NUM_RULES 1
6
#define YY_END_OF_BUFFER 1
7
/* This struct is not used in this scanner,
but its presence is necessary. */
struct
yy_trans_info
...
...
@@ -478,13 +478,13 @@ struct yy_trans_info
flex_int32_t
yy_verify
;
flex_int32_t
yy_nxt
;
};
static
yyconst
flex_int16_t
yy_accept
[
4
8
]
=
static
yyconst
flex_int16_t
yy_accept
[
4
4
]
=
{
0
,
0
,
0
,
1
8
,
1
6
,
1
,
2
,
1
6
,
1
1
,
1
2
,
1
5
,
1
6
,
7
,
7
,
1
6
,
1
3
,
1
4
,
1
6
,
1
6
,
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
0
,
0
,
1
7
,
1
5
,
1
,
2
,
1
5
,
1
0
,
1
1
,
1
4
,
1
5
,
5
,
5
,
1
5
,
1
2
,
1
3
,
1
5
,
1
5
,
1
5
,
1
,
2
,
0
,
3
,
5
,
0
,
6
,
0
,
0
,
0
,
4
,
9
,
0
,
0
,
0
,
0
,
0
,
0
,
7
,
0
,
0
,
0
,
8
,
0
}
;
static
yyconst
flex_int32_t
yy_ec
[
256
]
=
...
...
@@ -526,60 +526,54 @@ static yyconst flex_int32_t yy_meta[28] =
1
,
1
,
1
,
1
,
1
,
1
,
1
}
;
static
yyconst
flex_int16_t
yy_base
[
50
]
=
static
yyconst
flex_int16_t
yy_base
[
46
]
=
{
0
,
0
,
0
,
75
,
7
6
,
72
,
7
0
,
24
,
7
6
,
7
6
,
7
6
,
20
,
2
6
,
2
8
,
61
,
7
6
,
7
6
,
48
,
4
3
,
66
,
6
2
,
6
0
,
76
,
3
7
,
39
,
38
,
3
5
,
0
,
76
,
3
7
,
45
,
7
6
,
46
,
0
,
4
2
,
35
,
55
,
35
,
3
0
,
76
,
34
,
30
,
76
,
34
,
3
1
,
3
3
,
76
,
76
,
66
,
28
0
,
0
,
62
,
6
3
,
59
,
5
7
,
55
,
6
3
,
6
3
,
6
3
,
19
,
2
1
,
2
3
,
47
,
6
3
,
6
3
,
37
,
3
3
,
28
,
5
2
,
5
0
,
48
,
6
3
,
26
,
0
,
6
3
,
31
,
24
,
3
2
,
0
,
6
3
,
29
,
22
,
2
4
,
19
,
23
,
19
,
6
3
,
23
,
20
,
22
,
63
,
6
3
,
3
6
,
35
}
;
static
yyconst
flex_int16_t
yy_def
[
50
]
=
static
yyconst
flex_int16_t
yy_def
[
46
]
=
{
0
,
4
7
,
1
,
4
7
,
4
7
,
4
7
,
4
7
,
4
8
,
4
7
,
4
7
,
4
7
,
4
7
,
4
7
,
4
7
,
4
7
,
4
7
,
4
7
,
4
7
,
4
7
,
4
7
,
4
7
,
4
8
,
4
7
,
4
8
,
4
8
,
4
8
,
4
7
,
4
9
,
4
7
,
4
7
,
4
7
,
4
7
,
4
8
,
4
9
,
4
7
,
4
7
,
4
8
,
4
7
,
4
7
,
4
7
,
4
7
,
4
7
,
47
,
47
,
47
,
47
,
4
7
,
0
,
4
7
,
4
7
4
3
,
1
,
4
3
,
4
3
,
4
3
,
4
3
,
4
4
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
4
,
4
3
,
4
3
,
4
5
,
4
3
,
4
3
,
4
3
,
4
3
,
4
5
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
4
3
,
0
,
4
3
,
4
3
}
;
static
yyconst
flex_int16_t
yy_nxt
[
1
04
]
=
static
yyconst
flex_int16_t
yy_nxt
[
9
1
]
=
{
0
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
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
14
,
4
,
4
,
15
,
16
,
17
,
4
,
4
,
4
,
4
,
4
,
18
,
4
,
4
,
19
,
4
,
4
,
24
,
24
,
24
,
24
,
24
,
24
,
25
,
24
,
24
,
22
,
30
,
22
,
42
,
41
,
40
,
39
,
38
,
37
,
36
,
35
,
34
,
33
,
32
,
31
,
23
,
21
,
20
,
29
,
28
,
27
,
26
,
23
,
21
,
20
,
43
,
3
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
}
;
static
yyconst
flex_int16_t
yy_chk
[
1
04
]
=
static
yyconst
flex_int16_t
yy_chk
[
9
1
]
=
{
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
,
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
1
,
1
,
1
,
1
,
1
,
1
,
1
,
11
,
11
,
12
,
12
,
13
,
13
,
12
,
24
,
24
,
44
,
45
,
44
,
41
,
40
,
39
,
37
,
36
,
35
,
34
,
33
,
32
,
29
,
28
,
27
,
22
,
21
,
20
,
19
,
18
,
17
,
14
,
7
,
6
,
5
,
3
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
}
;
/* Table of booleans, true if rule could match eol. */
static
yyconst
flex_int32_t
yy_rule_can_match_eol
[
1
8
]
=
static
yyconst
flex_int32_t
yy_rule_can_match_eol
[
1
7
]
=
{
0
,
0
,
1
,
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
,
};
static
yy_state_type
yy_last_accepting_state
;
static
char
*
yy_last_accepting_cpos
;
...
...
@@ -587,10 +581,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
7
]
=
static
yyconst
flex_int16_t
yy_rule_linenum
[
1
6
]
=
{
0
,
83
,
87
,
93
,
10
8
,
1
14
,
12
4
,
130
,
1
4
4
,
1
4
5
,
1
4
6
,
1
47
,
14
8
,
1
4
9
,
1
5
0
,
1
5
1
,
1
5
3
83
,
87
,
93
,
10
3
,
1
09
,
12
3
,
1
2
4
,
1
2
5
,
1
2
6
,
127
,
1
2
8
,
1
2
9
,
1
3
0
,
1
3
1
,
1
3
3
}
;
/* The intent behind this definition is that it'll catch
...
...
@@ -657,7 +651,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 6
61
"lexer.cc"
#line 6
55
"lexer.cc"
#define INITIAL 0
...
...
@@ -940,7 +934,7 @@ YY_DECL
loc
.
step
();
#line 9
44
"lexer.cc"
#line 9
38
"lexer.cc"
while
(
1
)
/* loops until end-of-file is reached */
{
...
...
@@ -969,13 +963,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
>=
4
8
)
if
(
yy_current_state
>=
4
4
)
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
!=
4
7
);
while
(
yy_current_state
!=
4
3
);
yy_cp
=
(
yy_last_accepting_cpos
);
yy_current_state
=
(
yy_last_accepting_state
);
...
...
@@ -1004,13 +998,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
7
)
else
if
(
yy_act
<
1
6
)
fprintf
(
stderr
,
"--accepting rule at line %ld (
\"
%s
\"
)
\n
"
,
(
long
)
yy_rule_linenum
[
yy_act
],
yytext
);
else
if
(
yy_act
==
1
7
)
else
if
(
yy_act
==
1
6
)
fprintf
(
stderr
,
"--accepting default rule (
\"
%s
\"
)
\n
"
,
yytext
);
else
if
(
yy_act
==
1
8
)
else
if
(
yy_act
==
1
7
)
fprintf
(
stderr
,
"--(end of buffer or a NUL)
\n
"
);
else
fprintf
(
stderr
,
"--EOF (start condition %d)
\n
"
,
YY_START
);
...
...
@@ -1047,33 +1041,6 @@ YY_RULE_SETUP
case
3
:
YY_RULE_SETUP
#line 93 "lexer.ll"
{
// A string containing a number. Quotes should be removed, see below.
std
::
string
tmp
(
yytext
+
1
);
tmp
.
resize
(
tmp
.
size
()
-
1
);
try
{
static_cast
<
void
>
(
boost
::
lexical_cast
<
int
>
(
tmp
));
}
catch
(
const
boost
::
bad_lexical_cast
&
)
{
// In fact it is not a valid number
return
isc
::
eval
::
EvalParser
::
make_STRING
(
tmp
,
loc
);
}
return
isc
::
eval
::
EvalParser
::
make_NUMBER
(
tmp
,
loc
);
}
YY_BREAK
case
4
:
YY_RULE_SETUP
#line 108 "lexer.ll"
{
// A string containing the "all" keyword.
return
isc
::
eval
::
EvalParser
::
make_ALL
(
"all"
,
loc
);
}
YY_BREAK
case
5
:
YY_RULE_SETUP
#line 114 "lexer.ll"
{
// A string has been matched. It contains the actual string and single quotes.
// We need to get those quotes out of the way and just use its content, e.g.
...
...
@@ -1084,87 +1051,92 @@ YY_RULE_SETUP
return
isc
::
eval
::
EvalParser
::
make_STRING
(
tmp
,
loc
);
}
YY_BREAK
case
6
:
case
4
:
YY_RULE_SETUP
#line 1
24
"lexer.ll"
#line 1
03
"lexer.ll"
{
// A hex string has been matched. It contains the '0x' or '0X' header
// followed by at least one hexadecimal digit.
return
isc
::
eval
::
EvalParser
::
make_HEXSTRING
(
yytext
,
loc
);
}
YY_BREAK
case
7
:
case
5
:
YY_RULE_SETUP
#line 1
3
0 "lexer.ll"
#line 10
9
"lexer.ll"
{
// An integer was found.
std
::
string
tmp
(
yytext
);
int
n
;
try
{
n
=
boost
::
lexical_cast
<
int
>
(
tmp
);
static_cast
<
void
>
(
boost
::
lexical_cast
<
int
>
(
tmp
)
)
;
}
catch
(
const
boost
::
bad_lexical_cast
&
)
{
driver
.
error
(
loc
,
"Failed to convert "
+
tmp
+
" to an integer."
);
}
return
isc
::
eval
::
EvalParser
::
make_INTEGER
(
n
,
loc
);
// The parser needs the string form as double conversion is no lossless
return
isc
::
eval
::
EvalParser
::
make_INTEGER
(
tmp
,
loc
);
}
YY_BREAK
case
8
:
case
6
:
YY_RULE_SETUP
#line 1
44
"lexer.ll"
#line 1
23
"lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_EQUAL
(
loc
);
YY_BREAK
case
9
:
case
7
:
YY_RULE_SETUP
#line 14
5
"lexer.ll"
#line 1
2
4 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_OPTION
(
loc
);
YY_BREAK
case
10
:
case
8
:
YY_RULE_SETUP
#line 1
46
"lexer.ll"
#line 1
25
"lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_SUBSTRING
(
loc
);
YY_BREAK
case
11
:
case
9
:
YY_RULE_SETUP
#line 126 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_ALL
(
loc
);
YY_BREAK
case
10
:
YY_RULE_SETUP
#line 1
4
7 "lexer.ll"
#line 1
2
7 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_LPAREN
(
loc
);
YY_BREAK
case
1
2
:
case
1
1
:
YY_RULE_SETUP
#line 1
4
8 "lexer.ll"
#line 1
2
8 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_RPAREN
(
loc
);
YY_BREAK
case
1
3
:
case
1
2
:
YY_RULE_SETUP
#line 1
4
9 "lexer.ll"
#line 1
2
9 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_LBRACKET
(
loc
);
YY_BREAK
case
1
4
:
case
1
3
:
YY_RULE_SETUP
#line 1
5
0 "lexer.ll"
#line 1
3
0 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_RBRACKET
(
loc
);
YY_BREAK
case
1
5
:
case
1
4
:
YY_RULE_SETUP
#line 1
5
1 "lexer.ll"
#line 1
3
1 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_COMA
(
loc
);
YY_BREAK
case
1
6
:
case
1
5
:
YY_RULE_SETUP
#line 1
5
3 "lexer.ll"
#line 1
3
3 "lexer.ll"
driver
.
error
(
loc
,
"Invalid character: "
+
std
::
string
(
yytext
));
YY_BREAK
case
YY_STATE_EOF
(
INITIAL
):
#line 1
5
4 "lexer.ll"
#line 1
3
4 "lexer.ll"
return
isc
::
eval
::
EvalParser
::
make_END
(
loc
);
YY_BREAK
case
1
7
:
case
1
6
:
YY_RULE_SETUP
#line 1
5
5 "lexer.ll"
#line 1
3
5 "lexer.ll"
ECHO
;
YY_BREAK
#line 11
68
"lexer.cc"
#line 11
40
"lexer.cc"
case
YY_END_OF_BUFFER
:
{
...
...
@@ -1477,7 +1449,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
>=
4
8
)
if
(
yy_current_state
>=
4
4
)
yy_c
=
yy_meta
[(
unsigned
int
)
yy_c
];
}
yy_current_state
=
yy_nxt
[
yy_base
[
yy_current_state
]
+
(
unsigned
int
)
yy_c
];
...
...
@@ -1510,11 +1482,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
>=
4
8
)
if
(
yy_current_state
>=
4
4
)
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
==
4
7
);
yy_is_jam
=
(
yy_current_state
==
4
3
);
return
yy_is_jam
?
0
:
yy_current_state
;
}
...
...
@@ -2252,7 +2224,7 @@ void yyfree (void * ptr )
/* %ok-for-header */
#line 1
5
5 "lexer.ll"
#line 1
3
5 "lexer.ll"
...
...
src/lib/eval/lexer.ll
View file @
751b714c
...
...
@@ -90,27 +90,6 @@ blank [ \t]
loc
.
step
()
;
}
\'
{
int
}
\'
{
//
A
string
containing
a
number
.
Quotes
should
be
removed
,
see
below
.
std:
:string
tmp
(
yytext+
1
)
;
tmp
.
resize
(
tmp
.
size
()
-
1
)
;
try
{
static_cast
<
void
>(
boost:
:lexical_cast
<
int
>(
tmp
))
;
}
catch
(
const
boost:
:bad_lexical_cast
&
)
{
//
In
fact
it
is
not
a
valid
number
return
isc:
:
eval:
:
EvalParser:
:make_STRING
(
tmp
,
loc
)
;
}
return
isc:
:
eval:
:
EvalParser:
:make_NUMBER
(
tmp
,
loc
)
;
}
"'all'"
{
//
A
string
containing
the
"all"
keyword
.
return
isc:
:
eval:
:
EvalParser:
:make_ALL
(
"all"
,
loc
)
;
}
\'
[
^\'\n
]*
\'
{
//
A
string
has
been
matched
.
It
contains
the
actual
string
and
single
quotes
.
//
We
need
to
get
those
quotes
out
of
the
way
and
just
use
its
content
,
e
.
g
.
...
...
@@ -131,19 +110,20 @@ blank [ \t]
//
An
integer
was
found
.
std:
:string
tmp
(
yytext
)
;
int
n
;
try
{
n
=
boost:
:lexical_cast
<
int
>(
tmp
)
;
static_cast
<
void
>(
boost:
:lexical_cast
<
int
>(
tmp
)
)
;
}
catch
(
const
boost:
:bad_lexical_cast
&
)
{
driver
.
error
(
loc
,
"Failed to convert "
+
tmp
+
" to an integer."
)
;
}
return
isc:
:
eval:
:
EvalParser:
:make_INTEGER
(
n
,
loc
)
;
//
The
parser
needs
the
string
form
as
double
conversion
is
no
lossless
return
isc:
:
eval:
:
EvalParser:
:make_INTEGER
(
tmp
,
loc
)
;
}
"=="
return
isc:
:
eval:
:
EvalParser:
:make_EQUAL
(
loc
)
;
"option"
return
isc:
:
eval:
:
EvalParser:
:make_OPTION
(
loc
)
;
"substring"
return
isc:
:
eval:
:
EvalParser:
:make_SUBSTRING
(
loc
)
;
"all"
return
isc:
:
eval:
:
EvalParser:
:make_ALL
(
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 @
751b714c
...
...
@@ -49,7 +49,7 @@
#line 51 "parser.cc" // lalr1.cc:412
// Unqualified %code blocks.
#line 3
8
"parser.yy" // lalr1.cc:413
#line 3
9
"parser.yy" // lalr1.cc:413
# include "eval_context.h"
...
...
@@ -251,14 +251,10 @@ namespace isc { namespace eval {
{
switch
(
that
.
type_get
())
{
case
15
:
// "integer"
value
.
move
<
int
>
(
that
.
value
);
break
;
case
11
:
// "a number in a constant string"
case
12
:
// "the all constant string"
case
13
:
// "constant string"
case
12
:
// "constant string"
case
13
:
// "integer"
case
14
:
// "constant hexstring"
case
15
:
// TOKEN
value
.
move
<
std
::
string
>
(
that
.
value
);
break
;
...
...
@@ -277,14 +273,10 @@ namespace isc { namespace eval {
state
=
that
.
state
;
switch
(
that
.
type_get
())
{
case
15
:
// "integer"
value
.
copy
<
int
>
(
that
.
value
);
break
;
case
11
:
// "a number in a constant string"
case
12
:
// "the all constant string"
case
13
:
// "constant string"
case
12
:
// "constant string"
case
13
:
// "integer"
case
14
:
// "constant hexstring"
case
15
:
// TOKEN
value
.
copy
<
std
::
string
>
(
that
.
value
);
break
;
...
...
@@ -324,39 +316,32 @@ namespace isc { namespace eval {
<<
yysym
.
location
<<
": "
;
switch
(
yytype
)
{
case
1
1
:
// "
a number in a
constant string"
case
1
2
:
// "constant string"
#line
58
"parser.yy" // lalr1.cc:636
#line
61
"parser.yy" // lalr1.cc:636
{
yyoutput
<<
yysym
.
value
.
template
as
<
std
::
string
>
();
}
#line 3
3
2 "parser.cc" // lalr1.cc:636
#line 32
4
"parser.cc" // lalr1.cc:636
break
;
case
1
2
:
// "
the all constant string
"
case
1
3
:
// "
integer
"
#line
58
"parser.yy" // lalr1.cc:636
#line
61
"parser.yy" // lalr1.cc:636
{
yyoutput
<<
yysym
.
value
.
template
as
<
std
::
string
>
();
}
#line 339 "parser.cc" // lalr1.cc:636
break
;
case
13
:
// "constant string"
#line 58 "parser.yy" // lalr1.cc:636
{
yyoutput
<<
yysym
.
value
.
template
as
<
std
::
string
>
();
}
#line 346 "parser.cc" // lalr1.cc:636
#line 331 "parser.cc" // lalr1.cc:636
break
;
case
14
:
// "constant hexstring"
#line
58
"parser.yy" // lalr1.cc:636
#line
61
"parser.yy" // lalr1.cc:636
{
yyoutput
<<
yysym
.
value
.
template
as
<
std
::
string
>
();
}
#line 3
5
3 "parser.cc" // lalr1.cc:636
#line 33
8
"parser.cc" // lalr1.cc:636
break
;
case
15
:
//
"integer"
case
15
:
//
TOKEN
#line
58
"parser.yy" // lalr1.cc:636
{
yyoutput
<<
yysym
.
value
.
template
as
<
in
t
>
();
}
#line 3
60
"parser.cc" // lalr1.cc:636
#line
61
"parser.yy" // lalr1.cc:636
{
yyoutput
<<
yysym
.
value
.
template
as
<
std
::
str
in
g
>
();
}
#line 3
45
"parser.cc" // lalr1.cc:636
break
;
...
...
@@ -556,14 +541,10 @@ namespace isc { namespace eval {
when using variants. */
switch
(
yyr1_
[
yyn
])
{
case
15
:
// "integer"
yylhs
.
value
.
build
<
int
>
();
break
;
case
11
:
// "a number in a constant string"
case
12
:
// "the all constant string"
case
13
:
// "constant string"
case
12
:
// "constant string"
case
13
:
// "integer"
case
14
:
// "constant hexstring"
case
15
:
// TOKEN
yylhs
.
value
.
build
<
std
::
string
>
();
break
;
...
...
@@ -585,104 +566,92 @@ namespace isc { namespace eval {
switch
(
yyn
)
{
case
3
:
#line 7
0
"parser.yy" // lalr1.cc:859
#line 7
3
"parser.yy" // lalr1.cc:859
{
TokenPtr
eq
(
new
TokenEqual
());
ctx
.
expression
.
push_back
(
eq
);
}
#line 5
94
"parser.cc" // lalr1.cc:859
#line 5
75
"parser.cc" // lalr1.cc:859
break
;
case
4
:
#line
77
"parser.yy" // lalr1.cc:859
#line
80
"parser.yy" // lalr1.cc:859
{
TokenPtr
str
(
new
TokenString
(
yystack_
[
0
].
value
.
as
<
std
::
string
>
()));
ctx
.
expression
.
push_back
(
str
);
}
#line
603
"parser.cc" // lalr1.cc:859
#line
584
"parser.cc" // lalr1.cc:859
break
;
case
5
:
#line 82 "parser.yy" // lalr1.cc:859
{
TokenPtr
str
(
new
TokenString
(
yystack_
[
0
].
value
.
as
<
std
::
string
>
()));
ctx
.
expression
.
push_back
(
str
);
}
#line 612 "parser.cc" // lalr1.cc:859
break
;
case
6
:
#line 87 "parser.yy" // lalr1.cc:859
{
TokenPtr
str
(
new
TokenString
(
"all"
));
ctx
.
expression
.
push_back
(
str
);
}
#line 621 "parser.cc" // lalr1.cc:859
break
;
case
7
:
#line 92 "parser.yy" // lalr1.cc:859
#line 85 "parser.yy" // lalr1.cc:859
{
TokenPtr
hex
(
new
TokenHexString
(
yystack_
[
0
].
value
.
as
<
std
::
string
>
()));
ctx
.
expression
.
push_back
(
hex
);
}
#line
630
"parser.cc" // lalr1.cc:859
#line
593
"parser.cc" // lalr1.cc:859
break
;
case
8
:
#line 9
7
"parser.yy" // lalr1.cc:859
case
6
:
#line 9
0
"parser.yy" // lalr1.cc:859
{
int
n
=
yystack_
[
1
].
value
.
as
<
int
>
();
int
n
;
try
{
n
=
boost
::
lexical_cast
<
int
>
(
yystack_
[
1
].
value
.
as
<
std
::
string
>
());
}
catch
(
const
boost
::
bad_lexical_cast
&
)
{
// This can't happen...