From 56017c172bd2c741eedc3dd4a9c0dce7c477daac Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 21 Oct 2008 18:04:46 -0500 Subject: [PATCH] stack::size instead of stack::height. * data/lalr1.cc (stack::height): Rename as... (stack::size): this. Fix the output type. Comment changes. --- ChangeLog | 8 ++++++++ data/lalr1.cc | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a7e2b729..2c8de9eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-11-03 Akim Demaille + + stack::size instead of stack::height. + * data/lalr1.cc (stack::height): Rename as... + (stack::size): this. + Fix the output type. + Comment changes. + 2008-11-03 Akim Demaille Use variants to support objects as semantic values. diff --git a/data/lalr1.cc b/data/lalr1.cc index de2c1def..cf44d1f4 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -897,7 +897,7 @@ b4_error_verbose_if([, yytoken])[)); } /* Pop the current state because it cannot handle the error token. */ - if (yystate_stack_.height () == 1) + if (yystate_stack_.size () == 1) YYABORT; yyerror_range[0] = yylocation_stack_[0]; @@ -940,7 +940,7 @@ b4_error_verbose_if([, yytoken])[)); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ yypop_ (yylen); - while (yystate_stack_.height () != 1) + while (yystate_stack_.size () != 1) { yydestruct_ ("Cleanup: popping", yystos_[yystate_stack_[0]], @@ -1235,17 +1235,17 @@ b4_copyright([Stack handling for Bison parsers in C++], } inline - unsigned int - height () const + typename S::size_type + size () const { return seq_.size (); } inline const_iterator begin () const { return seq_.rbegin (); } - inline const_iterator end () const { return seq_.rend (); } + inline const_iterator end () const { return seq_.rend (); } private: - + /// The wrapped container. S seq_; }; -- 2.45.2