aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1991-04-26 22:57:44 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1991-04-26 22:57:44 +0000
commit5cced1845900780fe787965618ff1e4e19947be7 (patch)
tree78b0f90e7570e75ae3eafba67b80d4fcac5e3993
parent81919cc85b6918763a63b3e74a71e0c1aeabbb12 (diff)
downloadgdb-5cced1845900780fe787965618ff1e4e19947be7.zip
gdb-5cced1845900780fe787965618ff1e4e19947be7.tar.gz
gdb-5cced1845900780fe787965618ff1e4e19947be7.tar.bz2
* expread.y (abs_decl): Accept '&' and '&' abs_decl.
expread.y (typebase): Add {unsigned,} long long {,int}. * expread.y (variable): Allow for destructor with foo::~name. * vax-opcode.h, expread.y, expprint.c, cplus-dem.c: Declare some things "const".
-rwxr-xr-xgdb/expread.y34
1 files changed, 32 insertions, 2 deletions
diff --git a/gdb/expread.y b/gdb/expread.y
index b59d4ec..44b1b5c 100755
--- a/gdb/expread.y
+++ b/gdb/expread.y
@@ -573,6 +573,24 @@ variable: typebase COLONCOLON name
write_exp_string ($3);
write_exp_elt_opcode (OP_SCOPE);
}
+ | typebase COLONCOLON '~' name
+ {
+ struct type *type = $1;
+ if (TYPE_CODE (type) != TYPE_CODE_STRUCT
+ && TYPE_CODE (type) != TYPE_CODE_UNION)
+ error ("`%s' is not defined as an aggregate type.",
+ TYPE_NAME (type));
+
+ if (strcmp (type_name_no_tag (type), $4.ptr))
+ error ("invalid destructor `%s::~%s'",
+ type_name_no_tag (type), $4.ptr);
+
+ write_exp_elt_opcode (OP_SCOPE);
+ write_exp_elt_type (type);
+ write_exp_string ($4);
+ write_exp_elt_opcode (OP_SCOPE);
+ write_exp_elt_opcode (UNOP_LOGNOT);
+ }
| COLONCOLON name
{
char *name = copy_name ($2);
@@ -733,6 +751,10 @@ abs_decl: '*'
{ push_type (tp_pointer); $$ = 0; }
| '*' abs_decl
{ push_type (tp_pointer); $$ = $2; }
+ | '&'
+ { push_type (tp_reference); $$ = 0; }
+ | '&' abs_decl
+ { push_type (tp_reference); $$ = $2; }
| direct_abs_decl
;
@@ -792,6 +814,14 @@ typebase
{ $$ = builtin_type_long; }
| UNSIGNED LONG INT_KEYWORD
{ $$ = builtin_type_unsigned_long; }
+ | LONG LONG
+ { $$ = builtin_type_long_long; }
+ | LONG LONG INT_KEYWORD
+ { $$ = builtin_type_long_long; }
+ | UNSIGNED LONG LONG
+ { $$ = builtin_type_unsigned_long_long; }
+ | UNSIGNED LONG LONG INT_KEYWORD
+ { $$ = builtin_type_unsigned_long_long; }
| SHORT INT_KEYWORD
{ $$ = builtin_type_short; }
| UNSIGNED SHORT INT_KEYWORD
@@ -1152,13 +1182,13 @@ struct token
enum exp_opcode opcode;
};
-static struct token tokentab3[] =
+const static struct token tokentab3[] =
{
{">>=", ASSIGN_MODIFY, BINOP_RSH},
{"<<=", ASSIGN_MODIFY, BINOP_LSH}
};
-static struct token tokentab2[] =
+const static struct token tokentab2[] =
{
{"+=", ASSIGN_MODIFY, BINOP_ADD},
{"-=", ASSIGN_MODIFY, BINOP_SUB},