* data/lalr1.cc: Reinstall the former ctor, for sake of

compatibility, but warn it will be removed.
Move towards a more standard C++ coding style (i.e., type *var ->
type* var).
This commit is contained in:
Akim Demaille
2004-09-29 12:41:58 +00:00
parent 3fee967f83
commit b203fc2c07
2 changed files with 30 additions and 12 deletions

View File

@@ -1,3 +1,10 @@
2004-09-29 Akim Demaille <akim@epita.fr>
* data/lalr1.cc: Reinstall the former ctor, for sake of
compatibility, but warn it will be removed.
Move towards a more standard C++ coding style (i.e., type *var ->
type* var).
2004-09-27 Paul Eggert <eggert@cs.ucla.edu> 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
* src/parse-gram.y (add_param): Rewrite to avoid strchr, * src/parse-gram.y (add_param): Rewrite to avoid strchr,
@@ -10,7 +17,7 @@
2004-09-27 Akim Demaille <akim@epita.fr> 2004-09-27 Akim Demaille <akim@epita.fr>
* data/lalr1.cc (b4_parse_param_decl_1): New. * data/lalr1.cc (b4_parse_param_decl_1): New.
(b4_parse_param_decl): Use it to have different names bw attribute (b4_parse_param_decl): Use it to have different names between attribute
and argument names. and argument names.
(b4_cc_constructor_call): Likewise. (b4_cc_constructor_call): Likewise.

View File

@@ -205,8 +205,8 @@ namespace yy
{ {
typedef ]b4_int_type_for([b4_translate])[ TokenNumberType; typedef ]b4_int_type_for([b4_translate])[ TokenNumberType;
typedef ]b4_int_type_for([b4_rhs])[ RhsNumberType; typedef ]b4_int_type_for([b4_rhs])[ RhsNumberType;
typedef int StateType; typedef int StateType;
typedef yystype SemanticType; typedef yystype SemanticType;
typedef ]b4_location_type[ LocationType; typedef ]b4_location_type[ LocationType;
}; };
} }
@@ -233,6 +233,17 @@ namespace yy
{ {
} }
]b4_parser_class_name[ (bool debug,
LocationType][]b4_param[]b4_parse_param_decl[) :
]b4_constructor[][debug_ (debug),
cdebug_ (std::cerr)]b4_parse_param_cons[
{
cdebug_ << __FILE__ << ':' << __LINE__
<< ": this constructor is provided by backward compatibility"
<< ", but will be removed in the near future."
<< std::endl;
}
virtual ~]b4_parser_class_name[ () virtual ~]b4_parser_class_name[ ()
{ {
} }
@@ -247,8 +258,8 @@ namespace yy
virtual void report_syntax_error_ (); virtual void report_syntax_error_ ();
#if YYDEBUG #if YYDEBUG
virtual void symprint_ (int yytype, virtual void symprint_ (int yytype,
const SemanticType *yyvaluep, const SemanticType* yyvaluep,
const LocationType *yylocationp); const LocationType* yylocationp);
#endif /* ! YYDEBUG */ #endif /* ! YYDEBUG */
@@ -286,9 +297,9 @@ namespace yy
/* Even more tables. */ /* Even more tables. */
inline TokenNumberType translate_ (int token); inline TokenNumberType translate_ (int token);
inline void destruct_ (const char *yymsg, inline void destruct_ (const char* yymsg,
int yytype, int yytype,
SemanticType *yyvaluep, LocationType *yylocationp); SemanticType* yyvaluep, LocationType* yylocationp);
/// Pop \a n symbols the three stacks. /// Pop \a n symbols the three stacks.
inline void pop (unsigned int n = 1); inline void pop (unsigned int n = 1);
@@ -317,7 +328,7 @@ namespace yy
/* Debugging. */ /* Debugging. */
int debug_; int debug_;
std::ostream &cdebug_; std::ostream& cdebug_;
/* Look-ahead and look-ahead in internal form. */ /* Look-ahead and look-ahead in internal form. */
int looka_; int looka_;
@@ -398,7 +409,7 @@ do { \
void void
yy::]b4_parser_class_name[::symprint_ (int yytype, yy::]b4_parser_class_name[::symprint_ (int yytype,
const SemanticType *yyvaluep, const LocationType *yylocationp) const SemanticType* yyvaluep, const LocationType* yylocationp)
{ {
/* Pacify ``unused variable'' warnings. */ /* Pacify ``unused variable'' warnings. */
(void) yyvaluep; (void) yyvaluep;
@@ -418,8 +429,8 @@ yy::]b4_parser_class_name[::symprint_ (int yytype,
#endif /* ! YYDEBUG */ #endif /* ! YYDEBUG */
void void
yy::]b4_parser_class_name[::destruct_ (const char *yymsg, yy::]b4_parser_class_name[::destruct_ (const char* yymsg,
int yytype, SemanticType *yyvaluep, LocationType *yylocationp) int yytype, SemanticType* yyvaluep, LocationType* yylocationp)
{ {
/* Pacify ``unused variable'' warnings. */ /* Pacify ``unused variable'' warnings. */
(void) yyvaluep; (void) yyvaluep;
@@ -1245,7 +1256,7 @@ namespace yy
} }
/** \brief Add and assign a Location */ /** \brief Add and assign a Location */
inline Location &operator+= (Location& res, unsigned int width) inline Location& operator+= (Location& res, unsigned int width)
{ {
res.columns (width); res.columns (width);
return res; return res;