mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-01 08:54:44 +08:00
2001-09-20 Michael Snyder <msnyder@redhat.com>
Changes by Daniel Berlin <dan@cgsoftware.com>, to support better parsing of const and volatile type expressions. * c-exp.y (const_and_volatile, const_or_volatile_noopt, const_or_volatile): New non-terminals. (ptype): Use new rule for const_or_volatile. (typebase): Use new rule for const_or_volatile_noopt. * parser-defs.h (enum type_pieces): New values tp_const, tp_volatile. * parse.c (follow_types): Handle tp_const and tp_volatile on the type stack: call make_cv_type to create new const/volatile type.
This commit is contained in:
@ -106,6 +106,17 @@
|
|||||||
|
|
||||||
* c-exp.y (typebase): Accept (signed long long) as a type expr.
|
* c-exp.y (typebase): Accept (signed long long) as a type expr.
|
||||||
|
|
||||||
|
2001-09-20 Michael Snyder <msnyder@redhat.com>
|
||||||
|
Changes by Daniel Berlin <dan@cgsoftware.com>, to support
|
||||||
|
better parsing of const and volatile type expressions.
|
||||||
|
* c-exp.y (const_and_volatile, const_or_volatile_noopt,
|
||||||
|
const_or_volatile): New non-terminals.
|
||||||
|
(ptype): Use new rule for const_or_volatile.
|
||||||
|
(typebase): Use new rule for const_or_volatile_noopt.
|
||||||
|
* parser-defs.h (enum type_pieces): New values tp_const, tp_volatile.
|
||||||
|
* parse.c (follow_types): Handle tp_const and tp_volatile on the
|
||||||
|
type stack: call make_cv_type to create new const/volatile type.
|
||||||
|
|
||||||
2001-09-20 Kevin Buettner <kevinb@redhat.com>
|
2001-09-20 Kevin Buettner <kevinb@redhat.com>
|
||||||
|
|
||||||
* solib-svr4.c (fetch_link_map_offsets): Add comment.
|
* solib-svr4.c (fetch_link_map_offsets): Add comment.
|
||||||
|
34
gdb/c-exp.y
34
gdb/c-exp.y
@ -720,21 +720,22 @@ variable: name_not_typename
|
|||||||
|
|
||||||
|
|
||||||
ptype : typebase
|
ptype : typebase
|
||||||
/* "const" and "volatile" are curently ignored. A type qualifier
|
| ptype const_or_volatile abs_decl const_or_volatile
|
||||||
before the type is currently handled in the typebase rule.
|
|
||||||
The reason for recognizing these here (shift/reduce conflicts)
|
|
||||||
might be obsolete now that some pointer to member rules have
|
|
||||||
been deleted. */
|
|
||||||
| typebase CONST_KEYWORD
|
|
||||||
| typebase VOLATILE_KEYWORD
|
|
||||||
| typebase abs_decl
|
|
||||||
{ $$ = follow_types ($1); }
|
|
||||||
| typebase CONST_KEYWORD abs_decl
|
|
||||||
{ $$ = follow_types ($1); }
|
|
||||||
| typebase VOLATILE_KEYWORD abs_decl
|
|
||||||
{ $$ = follow_types ($1); }
|
{ $$ = follow_types ($1); }
|
||||||
;
|
;
|
||||||
|
const_and_volatile: CONST_KEYWORD VOLATILE_KEYWORD
|
||||||
|
| VOLATILE_KEYWORD CONST_KEYWORD
|
||||||
|
;
|
||||||
|
const_or_volatile_noopt: const_and_volatile
|
||||||
|
{ push_type (tp_const); push_type (tp_volatile);}
|
||||||
|
| CONST_KEYWORD
|
||||||
|
{ push_type (tp_const);}
|
||||||
|
| VOLATILE_KEYWORD
|
||||||
|
{ push_type (tp_volatile); }
|
||||||
|
;
|
||||||
|
const_or_volatile: const_or_volatile_noopt
|
||||||
|
|
|
||||||
|
;
|
||||||
abs_decl: '*'
|
abs_decl: '*'
|
||||||
{ push_type (tp_pointer); $$ = 0; }
|
{ push_type (tp_pointer); $$ = 0; }
|
||||||
| '*' abs_decl
|
| '*' abs_decl
|
||||||
@ -851,11 +852,8 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */
|
|||||||
{ $$ = lookup_template_type(copy_name($2), $4,
|
{ $$ = lookup_template_type(copy_name($2), $4,
|
||||||
expression_context_block);
|
expression_context_block);
|
||||||
}
|
}
|
||||||
/* "const" and "volatile" are curently ignored. A type qualifier
|
| const_or_volatile_noopt typebase { $$ = follow_types ($2); }
|
||||||
after the type is handled in the ptype rule. I think these could
|
| typebase const_or_volatile_noopt { $$ = follow_types ($1); }
|
||||||
be too. */
|
|
||||||
| CONST_KEYWORD typebase { $$ = $2; }
|
|
||||||
| VOLATILE_KEYWORD typebase { $$ = $2; }
|
|
||||||
;
|
;
|
||||||
|
|
||||||
typename: TYPENAME
|
typename: TYPENAME
|
||||||
|
Reference in New Issue
Block a user