summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkim Demaille <demaille@gostai.com>2009-08-16 07:38:40 +0200
committerAkim Demaille <demaille@gostai.com>2009-08-19 10:37:00 +0200
commitceb8b8e6b5eeb01d0842c253920abb3c73d51827 (patch)
treef21eb0c6f87f35aead0c00304b70374e36a4a303
parent7580c37942a7f33d3c348d2bf71964fbbba89f1f (diff)
downloadbison-ceb8b8e6b5eeb01d0842c253920abb3c73d51827.tar.gz
lalr1.cc: use state_type.
* data/lalr1.cc (yysyntax_error_): Use state_type. Move argument names into yy*.
-rw-r--r--ChangeLog6
-rw-r--r--data/lalr1.cc12
2 files changed, 12 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f5da787e..6cf3127e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-08-19 Akim Demaille <demaille@gostai.com>
+ lalr1.cc: use state_type.
+ * data/lalr1.cc (yysyntax_error_): Use state_type.
+ Move argument names into yy*.
+
+2009-08-19 Akim Demaille <demaille@gostai.com>
+
lalr1.cc: get rid of yyparse's yystate.
yystate and yystack_[0].state are equal, keep only the latter.
The former was also used as a temporary variable to compute the
diff --git a/data/lalr1.cc b/data/lalr1.cc
index 09fedabe..2a9316de 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -232,14 +232,14 @@ do { \
virtual void error (]b4_locations_if([const location_type& loc, ])[const std::string& msg);
private:
- /// Generate an error message.
- /// \param state the state where the error occurred.
- /// \param tok the lookahead token.
- virtual std::string yysyntax_error_ (int yystate, int tok);
-
/// State numbers.
typedef int state_type;
+ /// Generate an error message.
+ /// \param yystate the state where the error occurred.
+ /// \param yytoken the lookahead token.
+ virtual std::string yysyntax_error_ (state_type yystate, int yytoken);
+
/// Compute post-reduction state.
/// \param yystate the current state
/// \param yylhs the nonterminal to push on the stack
@@ -946,7 +946,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
// Generate an error message.
std::string
]b4_parser_class_name[::yysyntax_error_ (]dnl
-b4_error_verbose_if([int yystate, int yytoken],
+b4_error_verbose_if([state_type yystate, int yytoken],
[int, int])[)
{
std::string yyres;]b4_error_verbose_if([[