This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ parser: Should we get rid of cp_parser_declarator_id?


Volker Reichelt <reichelt@igpm.rwth-aachen.de> writes:

| The C++ parser contains the static function
|   cp_parser_declarator_id (cp_parser* parser)
| which consists of a lot of comments and a single statement
| 
|   return cp_parser_id_expression (parser,
|                                   /*template_keyword_p=*/false,
|                                   /*check_dependency_p=*/false,
|                                   /*template_p=*/NULL,
|                                   /*declarator_p=*/true);
| 
| and which has a single caller.
| 
| Shouldn't we fold cp_parser_declarator_id into the caller and call
| cp_parser_id_expression directly?
| But what about the comments then? (Are they still accurate, btw.?)
| Or should we leave the function intact just to preserve the comments?

If we make it "static inline", would not we gain the same efficiency
and preserve the comments and all that?  In general, the methodoly
seems to have a function for each non-terminal -- following a long
tradition of recursive descent parser -- and maintaining that
principle is helpful for code clarity.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]