Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Pavel Zhukov
Kea
Commits
f6f85dfd
Commit
f6f85dfd
authored
Oct 30, 2018
by
Tomek Mrugalski
🛰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#129,!55] Reverted not needed changes
parent
ef8592eb
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
311 additions
and
278 deletions
+311
-278
src/bin/agent/location.hh
src/bin/agent/location.hh
+1
-0
src/bin/agent/position.hh
src/bin/agent/position.hh
+1
-0
src/bin/agent/stack.hh
src/bin/agent/stack.hh
+1
-0
src/lib/eval/location.hh
src/lib/eval/location.hh
+15
-17
src/lib/eval/parser.cc
src/lib/eval/parser.cc
+237
-199
src/lib/eval/parser.h
src/lib/eval/parser.h
+19
-25
src/lib/eval/position.hh
src/lib/eval/position.hh
+16
-16
src/lib/eval/stack.hh
src/lib/eval/stack.hh
+21
-21
No files found.
src/bin/agent/location.hh
View file @
f6f85dfd
// Generated 201804111444
// A Bison parser, made by GNU Bison 3.0.4.
// Locations for Bison parsers in C++
...
...
src/bin/agent/position.hh
View file @
f6f85dfd
// Generated 201804111444
// A Bison parser, made by GNU Bison 3.0.4.
// Positions for Bison parsers in C++
...
...
src/bin/agent/stack.hh
View file @
f6f85dfd
// Generated 201804111444
// A Bison parser, made by GNU Bison 3.0.4.
// Stack handling for Bison parsers in C++
...
...
src/lib/eval/location.hh
View file @
f6f85dfd
// 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:29
6
#line 14 "parser.yy" // location.cc:29
2
namespace
isc
{
namespace
eval
{
#line 46 "location.hh" // location.cc:29
6
#line 46 "location.hh" // location.cc:29
2
/// 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:29
6
#line 14 "parser.yy" // location.cc:29
2
}
}
// isc::eval
#line 1
92 "location.hh" // location.cc:296
#line 1
89 "location.hh" // location.cc:292
#endif // !YY_EVAL_LOCATION_HH_INCLUDED
src/lib/eval/parser.cc
View file @
f6f85dfd
This diff is collapsed.
Click to expand it.
src/lib/eval/parser.h
View file @
f6f85dfd
// 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:37
7
#line 17 "parser.yy" // lalr1.cc:37
9
#include <string>
#include <eval/token.h>
...
...
@@ -51,7 +51,7 @@
using
namespace
isc
::
dhcp
;
using
namespace
isc
::
eval
;
#line 55 "parser.h" // lalr1.cc:37
7
#line 55 "parser.h" // lalr1.cc:37
9
# 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:37
7
#line 14 "parser.yy" // lalr1.cc:37
9
namespace
isc
{
namespace
eval
{
#line 140 "parser.h" // lalr1.cc:37
7
#line 140 "parser.h" // lalr1.cc:37
9
...
...
@@ -914,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.
...
...
@@ -942,7 +944,7 @@ 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
...
...
@@ -1002,12 +1004,12 @@ namespace isc { namespace eval {
35
,
36
,
37
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
53
,
54
};
const
unsigned
int
user_token_number_max_
=
309
;
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_
;
...
...
@@ -1021,19 +1023,17 @@ 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
62
:
// option_repr_type
value
.
copy
<
TokenOption
::
RepresentationType
>
(
other
.
value
);
...
...
@@ -1082,16 +1082,14 @@ 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
62
:
// option_repr_type
value
.
copy
<
TokenOption
::
RepresentationType
>
(
v
);
...
...
@@ -1214,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
()
{
...
...
@@ -1236,7 +1232,7 @@ namespace isc { namespace eval {
}
// Type destructor.
switch
(
yytype
)
switch
(
yytype
)
{
case
62
:
// option_repr_type
value
.
template
destroy
<
TokenOption
::
RepresentationType
>
();
...
...
@@ -1287,7 +1283,6 @@ namespace isc { namespace eval {
}
template
<
typename
Base
>
inline
bool
EvalParser
::
basic_symbol
<
Base
>::
empty
()
const
{
...
...
@@ -1295,12 +1290,11 @@ 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
62
:
// option_repr_type
value
.
move
<
TokenOption
::
RepresentationType
>
(
s
.
value
);
...
...
@@ -1727,9 +1721,9 @@ namespace isc { namespace eval {
}
#line 14 "parser.yy" // lalr1.cc:37
7
#line 14 "parser.yy" // lalr1.cc:37
9
}
}
// isc::eval
#line 17
33 "parser.h" // lalr1.cc:377
#line 17
27 "parser.h" // lalr1.cc:379
...
...
src/lib/eval/position.hh
View file @
f6f85dfd
// 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:29
6
#line 14 "parser.yy" // location.cc:29
2
namespace
isc
{
namespace
eval
{
#line 56 "position.hh" // location.cc:29
6
#line 56 "position.hh" // location.cc:29
2
/// 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:29
6
#line 14 "parser.yy" // location.cc:29
2
}
}
// isc::eval
#line 1
80 "position.hh" // location.cc:296
#line 1
79 "position.hh" // location.cc:292
#endif // !YY_EVAL_POSITION_HH_INCLUDED
src/lib/eval/stack.hh
View file @
f6f85dfd
// 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:13
2
#line 14 "parser.yy" // stack.hh:13
1
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
i
nt
i
)
operator
[]
(
unsigned
i
)
{
return
seq_
[
seq_
.
size
()
-
1
-
i
];
}
inline
/// Random access.
///
/// Index 0 returns the topmost element.
const
T
&
operator
[]
(
unsigned
i
nt
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
i
nt
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:13
2
#line 14 "parser.yy" // stack.hh:13
1
}
}
// isc::eval
#line 15
6 "stack.hh" // stack.hh:132
#line 15
5 "stack.hh" // stack.hh:131
#endif // !YY_EVAL_STACK_HH_INCLUDED
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment