summaryrefslogtreecommitdiffstats
path: root/src/bin/dhcp6/location.hh
diff options
context:
space:
mode:
authorRazvan Becheriu <razvan@isc.org>2022-04-05 00:49:59 +0200
committerRazvan Becheriu <razvan@isc.org>2022-04-05 09:51:55 +0200
commit2076cde1821388eb75075e4c9a7fcf88569496cd (patch)
tree0fd4f8ea5df9ca257c3bdff4bba07c3e648af0bd /src/bin/dhcp6/location.hh
parent[#1716] addressed comments (diff)
downloadkea-2076cde1821388eb75075e4c9a7fcf88569496cd.tar.xz
kea-2076cde1821388eb75075e4c9a7fcf88569496cd.zip
[#1716] regenerated parser files
Diffstat (limited to 'src/bin/dhcp6/location.hh')
-rw-r--r--src/bin/dhcp6/location.hh55
1 files changed, 41 insertions, 14 deletions
diff --git a/src/bin/dhcp6/location.hh b/src/bin/dhcp6/location.hh
index 6805958b0f..bf5ebc3716 100644
--- a/src/bin/dhcp6/location.hh
+++ b/src/bin/dhcp6/location.hh
@@ -1,9 +1,8 @@
-// Generated 202203302203
-// A Bison parser, made by GNU Bison 3.8.2.
+// A Bison parser, made by GNU Bison 3.5.1.
// Locations for Bison parsers in C++
-// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
+// Copyright (C) 2002-2015, 2018-2020 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
@@ -16,7 +15,7 @@
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <https://www.gnu.org/licenses/>.
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
// As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work
@@ -62,13 +61,11 @@ namespace isc { namespace dhcp {
class position
{
public:
- /// Type for file name.
- typedef const std::string filename_type;
/// Type for line and column numbers.
typedef int counter_type;
/// Construct a position.
- explicit position (filename_type* f = YY_NULLPTR,
+ explicit position (std::string* f = YY_NULLPTR,
counter_type l = 1,
counter_type c = 1)
: filename (f)
@@ -78,7 +75,7 @@ namespace isc { namespace dhcp {
/// Initialization.
- void initialize (filename_type* fn = YY_NULLPTR,
+ void initialize (std::string* fn = YY_NULLPTR,
counter_type l = 1,
counter_type c = 1)
{
@@ -107,7 +104,7 @@ namespace isc { namespace dhcp {
/** \} */
/// File name to which this position refers.
- filename_type* filename;
+ std::string* filename;
/// Current line number.
counter_type line;
/// Current column number.
@@ -150,6 +147,24 @@ namespace isc { namespace dhcp {
return res -= width;
}
+ /// Compare two position objects.
+ inline bool
+ operator== (const position& pos1, const position& pos2)
+ {
+ return (pos1.line == pos2.line
+ && pos1.column == pos2.column
+ && (pos1.filename == pos2.filename
+ || (pos1.filename && pos2.filename
+ && *pos1.filename == *pos2.filename)));
+ }
+
+ /// Compare two position objects.
+ inline bool
+ operator!= (const position& pos1, const position& pos2)
+ {
+ return !(pos1 == pos2);
+ }
+
/** \brief Intercept output stream redirection.
** \param ostr the destination output stream
** \param pos a reference to the position to redirect
@@ -167,8 +182,6 @@ namespace isc { namespace dhcp {
class location
{
public:
- /// Type for file name.
- typedef position::filename_type filename_type;
/// Type for line and column numbers.
typedef position::counter_type counter_type;
@@ -185,7 +198,7 @@ namespace isc { namespace dhcp {
{}
/// Construct a 0-width location in \a f, \a l, \a c.
- explicit location (filename_type* f,
+ explicit location (std::string* f,
counter_type l = 1,
counter_type c = 1)
: begin (f, l, c)
@@ -194,7 +207,7 @@ namespace isc { namespace dhcp {
/// Initialization.
- void initialize (filename_type* f = YY_NULLPTR,
+ void initialize (std::string* f = YY_NULLPTR,
counter_type l = 1,
counter_type c = 1)
{
@@ -276,6 +289,20 @@ namespace isc { namespace dhcp {
return res -= width;
}
+ /// Compare two location objects.
+ inline bool
+ operator== (const location& loc1, const location& loc2)
+ {
+ return loc1.begin == loc2.begin && loc1.end == loc2.end;
+ }
+
+ /// Compare two location objects.
+ inline bool
+ operator!= (const location& loc1, const location& loc2)
+ {
+ return !(loc1 == loc2);
+ }
+
/** \brief Intercept output stream redirection.
** \param ostr the destination output stream
** \param loc a reference to the location to redirect
@@ -302,6 +329,6 @@ namespace isc { namespace dhcp {
#line 14 "dhcp6_parser.yy"
} } // isc::dhcp
-#line 305 "location.hh"
+#line 333 "location.hh"
#endif // !YY_PARSER6_LOCATION_HH_INCLUDED