|
a/src/query/stack.hh |
|
b/src/query/stack.hh |
1 |
// A Bison parser, made by GNU Bison 3.0.2.
|
1 |
// A Bison parser, made by GNU Bison 3.0.4.
|
2 |
|
2 |
|
3 |
// Stack handling for Bison parsers in C++
|
3 |
// Stack handling for Bison parsers in C++
|
4 |
|
4 |
|
5 |
// Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
5 |
// Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
6 |
|
6 |
|
7 |
// This program is free software: you can redistribute it and/or modify
|
7 |
// This program is free software: you can redistribute it and/or modify
|
8 |
// it under the terms of the GNU General Public License as published by
|
8 |
// it under the terms of the GNU General Public License as published by
|
9 |
// the Free Software Foundation, either version 3 of the License, or
|
9 |
// the Free Software Foundation, either version 3 of the License, or
|
10 |
// (at your option) any later version.
|
10 |
// (at your option) any later version.
|
|
... |
|
... |
40 |
|
40 |
|
41 |
# include <vector>
|
41 |
# include <vector>
|
42 |
|
42 |
|
43 |
|
43 |
|
44 |
namespace yy {
|
44 |
namespace yy {
|
45 |
#line 46 "stack.hh" // stack.hh:133
|
45 |
#line 46 "stack.hh" // stack.hh:132
|
46 |
template <class T, class S = std::vector<T> >
|
46 |
template <class T, class S = std::vector<T> >
|
47 |
class stack
|
47 |
class stack
|
48 |
{
|
48 |
{
|
49 |
public:
|
49 |
public:
|
50 |
// Hide our reversed order.
|
50 |
// Hide our reversed order.
|
|
... |
|
... |
52 |
typedef typename S::const_reverse_iterator const_iterator;
|
52 |
typedef typename S::const_reverse_iterator const_iterator;
|
53 |
|
53 |
|
54 |
stack ()
|
54 |
stack ()
|
55 |
: seq_ ()
|
55 |
: seq_ ()
|
56 |
{
|
56 |
{
|
|
|
57 |
seq_.reserve (200);
|
57 |
}
|
58 |
}
|
58 |
|
59 |
|
59 |
stack (unsigned int n)
|
60 |
stack (unsigned int n)
|
60 |
: seq_ (n)
|
61 |
: seq_ (n)
|
61 |
{
|
62 |
{}
|
62 |
}
|
|
|
63 |
|
63 |
|
64 |
inline
|
64 |
inline
|
65 |
T&
|
65 |
T&
|
66 |
operator[] (unsigned int i)
|
66 |
operator[] (unsigned int i)
|
67 |
{
|
67 |
{
|
|
... |
|
... |
134 |
{
|
134 |
{
|
135 |
public:
|
135 |
public:
|
136 |
slice (const S& stack, unsigned int range)
|
136 |
slice (const S& stack, unsigned int range)
|
137 |
: stack_ (stack)
|
137 |
: stack_ (stack)
|
138 |
, range_ (range)
|
138 |
, range_ (range)
|
139 |
{
|
139 |
{}
|
140 |
}
|
|
|
141 |
|
140 |
|
142 |
inline
|
141 |
inline
|
143 |
const T&
|
142 |
const T&
|
144 |
operator [] (unsigned int i) const
|
143 |
operator [] (unsigned int i) const
|
145 |
{
|
144 |
{
|
|
... |
|
... |
151 |
unsigned int range_;
|
150 |
unsigned int range_;
|
152 |
};
|
151 |
};
|
153 |
|
152 |
|
154 |
|
153 |
|
155 |
} // yy
|
154 |
} // yy
|
156 |
#line 157 "stack.hh" // stack.hh:133
|
155 |
#line 156 "stack.hh" // stack.hh:132
|
157 |
|
156 |
|
158 |
#endif // !YY_YY_STACK_HH_INCLUDED
|
157 |
#endif // !YY_YY_STACK_HH_INCLUDED
|