mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
c++: display the stack in the same order as in C
Currently the C and C++ parse traces differ in the order in which the stack is displayed: bottom up in C, top down in C++. Let's stick to the C order. * data/skeletons/stack.hh (stack::iterator, stack::const_iterator) (begin, end): Be forward, not backward.
This commit is contained in:
@@ -32,8 +32,8 @@ m4_define([b4_stack_define],
|
||||
{
|
||||
public:
|
||||
// Hide our reversed order.
|
||||
typedef typename S::reverse_iterator iterator;
|
||||
typedef typename S::const_reverse_iterator const_iterator;
|
||||
typedef typename S::iterator iterator;
|
||||
typedef typename S::const_iterator const_iterator;
|
||||
typedef typename S::size_type size_type;
|
||||
typedef typename std::ptrdiff_t index_type;
|
||||
|
||||
@@ -101,14 +101,14 @@ m4_define([b4_stack_define],
|
||||
const_iterator
|
||||
begin () const YY_NOEXCEPT
|
||||
{
|
||||
return seq_.rbegin ();
|
||||
return seq_.begin ();
|
||||
}
|
||||
|
||||
/// Bottom of the stack.
|
||||
const_iterator
|
||||
end () const YY_NOEXCEPT
|
||||
{
|
||||
return seq_.rend ();
|
||||
return seq_.end ();
|
||||
}
|
||||
|
||||
/// Present a slice of the top of a stack.
|
||||
|
||||
Reference in New Issue
Block a user