1 /* A Bison parser, made by GNU Bison 2.7.12-4996. */
3 /* Stack handling for Bison parsers in C++
5 Copyright (C) 2002-2013 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 cfg::stack class.
38 #ifndef YY_CFG_STACK_HH_INCLUDED
39 # define YY_CFG_STACK_HH_INCLUDED
45 /* Line 34 of stack.hh */
47 template <class T, class S = std::deque<T> >
51 // Hide our reversed order.
52 typedef typename S::reverse_iterator iterator;
53 typedef typename S::const_reverse_iterator const_iterator;
59 stack (unsigned int n) : seq_ (n)
65 operator [] (unsigned int i)
72 operator [] (unsigned int i) const
86 pop (unsigned int n = 1)
105 inline const_iterator begin () const { return seq_.rbegin (); }
106 inline const_iterator end () const { return seq_.rend (); }
109 stack (const stack&);
110 stack& operator= (const stack&);
114 /// Present a slice of the top of a stack.
115 template <class T, class S = stack<T> >
119 slice (const S& stack, unsigned int range)
127 operator [] (unsigned int i) const
129 return stack_[range_ - i];
138 /* Line 124 of stack.hh */
141 #endif /* !YY_CFG_STACK_HH_INCLUDED */