1
// A Bison parser, made by GNU Bison 3.0.4.
3
// Stack handling for Bison parsers in C++
5
// Copyright (C) 2002-2015 Free Software Foundation, Inc.
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
9
// the Free Software Foundation, either version 3 of the License, or
10
// (at your option) any later version.
12
// This program is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
17
// You should have received a copy of the GNU General Public License
18
// along with this program. If not, see <http://www.gnu.org/licenses/>.
20
// As a special exception, you may create a larger work that contains
21
// part or all of the Bison parser skeleton and distribute that work
22
// under terms of your choice, so long as that work isn't itself a
23
// parser generator using the skeleton or a modified version thereof
24
// as a parser skeleton. Alternatively, if you modify or redistribute
25
// the parser skeleton itself, you may (at your option) remove this
26
// special exception, which will cause the skeleton and the resulting
27
// Bison output files to be licensed under the GNU General Public
28
// License without this special exception.
30
// This special exception was added by the Free Software Foundation in
31
// version 2.2 of Bison.
35
** Define the imath::stack class.
38
#ifndef YY_IMATH_STACK_HH_INCLUDED
39
# define YY_IMATH_STACK_HH_INCLUDED
45
#line 46 "stack.hh" // stack.hh:132
46
template <class T, class S = std::vector<T> >
50
// Hide our reversed order.
51
typedef typename S::reverse_iterator iterator;
52
typedef typename S::const_reverse_iterator const_iterator;
60
stack (unsigned int n)
66
operator[] (unsigned int i)
68
return seq_[seq_.size () - 1 - i];
73
operator[] (unsigned int i) const
75
return seq_[seq_.size () - 1 - i];
78
/// Steal the contents of \a t.
80
/// Close to move-semantics.
86
operator[](0).move (t);
91
pop (unsigned int n = 1)
104
typename S::size_type
114
return seq_.rbegin ();
125
stack (const stack&);
126
stack& operator= (const stack&);
127
/// The wrapped container.
131
/// Present a slice of the top of a stack.
132
template <class T, class S = stack<T> >
136
slice (const S& stack, unsigned int range)
143
operator [] (unsigned int i) const
145
return stack_[range_ - i];
155
#line 156 "stack.hh" // stack.hh:132
157
#endif // !YY_IMATH_STACK_HH_INCLUDED
1
// A Bison parser, made by GNU Bison 3.5.1.
3
// Starting with Bison 3.2, this file is useless: the structure it
4
// used to define is now defined with the parser itself.
6
// To get rid of this file:
7
// 1. add '%require "3.2"' (or newer) to your grammar file
8
// 2. remove references to this file from your build system.