[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] c++: improve the signature of yysyntax_error_
From: |
Akim Demaille |
Subject: |
[PATCH 2/6] c++: improve the signature of yysyntax_error_ |
Date: |
Tue, 29 Jan 2013 09:04:33 +0100 |
* data/lalr1.cc: This function is const.
It takes a symbol_number_type.
---
data/lalr1.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/data/lalr1.cc b/data/lalr1.cc
index 2415603..a0a059a 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -206,8 +206,9 @@ b4_location_define])])[
/// 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);
+ /// \param yytoken the lookahead token type, or yyempty_.
+ virtual std::string yysyntax_error_ (state_type yystate,
+ symbol_number_type yytoken) const;
/// Compute post-reduction state.
/// \param yystate the current state
@@ -1011,8 +1012,8 @@ b4_dollar_popdef])[]dnl
// Generate an error message.
std::string
]b4_parser_class_name[::yysyntax_error_ (]dnl
-b4_error_verbose_if([state_type yystate, int yytoken],
- [int, int])[)
+b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
+ [state_type, symbol_number_type])[) const
{]b4_error_verbose_if([[
std::string yyres;
// Number of reported tokens (one for the "unexpected", one per
--
1.8.1.1
- [PATCH 0/6] {master} c++: various improvements, Akim Demaille, 2013/01/29
- [PATCH 2/6] c++: improve the signature of yysyntax_error_,
Akim Demaille <=
- [PATCH 4/6] c++: use more explicit types than int, Akim Demaille, 2013/01/29
- [PATCH 1/6] c++: style changes, Akim Demaille, 2013/01/29
- [PATCH 6/6] c++: please G++ 4.8 with -O3: type puning issue, Akim Demaille, 2013/01/29
- [PATCH 3/6] c++: value_type -> kind_type, Akim Demaille, 2013/01/29
- [PATCH 5/6] c++: please G++ 4.8 with -O3: array bounds, Akim Demaille, 2013/01/29