Commit f6f85dfd authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[#129,!55] Reverted not needed changes

parent ef8592eb
// Generated 201804111444
// A Bison parser, made by GNU Bison 3.0.4.
// Locations for Bison parsers in C++
......
// Generated 201804111444
// A Bison parser, made by GNU Bison 3.0.4.
// Positions for Bison parsers in C++
......
// Generated 201804111444
// A Bison parser, made by GNU Bison 3.0.4.
// Stack handling for Bison parsers in C++
......
// 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:296
#line 14 "parser.yy" // location.cc:292
namespace isc { namespace eval {
#line 46 "location.hh" // location.cc:296
#line 46 "location.hh" // location.cc:292
/// 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:296
#line 14 "parser.yy" // location.cc:292
} } // isc::eval
#line 192 "location.hh" // location.cc:296
#line 189 "location.hh" // location.cc:292
#endif // !YY_EVAL_LOCATION_HH_INCLUDED
This diff is collapsed.
// 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:377
#line 17 "parser.yy" // lalr1.cc:379
#include <string>
#include <eval/token.h>
......@@ -51,7 +51,7 @@
using namespace isc::dhcp;
using namespace isc::eval;
#line 55 "parser.h" // lalr1.cc:377
#line 55 "parser.h" // lalr1.cc:379
# 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:377
#line 14 "parser.yy" // lalr1.cc:379
namespace isc { namespace eval {
#line 140 "parser.h" // lalr1.cc:377
#line 140 "parser.h" // lalr1.cc:379
......@@ -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:377
#line 14 "parser.yy" // lalr1.cc:379
} } // isc::eval
#line 1733 "parser.h" // lalr1.cc:377
#line 1727 "parser.h" // lalr1.cc:379
......
// 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:296
#line 14 "parser.yy" // location.cc:292
namespace isc { namespace eval {
#line 56 "position.hh" // location.cc:296
#line 56 "position.hh" // location.cc:292
/// 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:296
#line 14 "parser.yy" // location.cc:292
} } // isc::eval
#line 180 "position.hh" // location.cc:296
#line 179 "position.hh" // location.cc:292
#endif // !YY_EVAL_POSITION_HH_INCLUDED
// 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:132
#line 14 "parser.yy" // stack.hh:131
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 int i)
operator[] (unsigned i)
{
return seq_[seq_.size () - 1 - i];
}
inline
/// Random access.
///
/// Index 0 returns the topmost element.
const T&
operator[] (unsigned int 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 int 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:132
#line 14 "parser.yy" // stack.hh:131
} } // isc::eval
#line 156 "stack.hh" // stack.hh:132
#line 155 "stack.hh" // stack.hh:131
#endif // !YY_EVAL_STACK_HH_INCLUDED
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment