struct type_stack *type_stack;
- struct objc_class_str class;
+ struct objc_class_str theclass;
}
%{
%token <ssym> UNKNOWN_CPP_NAME
%token <voidval> COMPLETE
%token <tsym> TYPENAME
-%token <class> CLASSNAME /* ObjC Class name */
+%token <theclass> CLASSNAME /* ObjC Class name */
%type <sval> name
%type <svec> string_exp
%type <ssym> name_not_typename
-%type <tsym> typename
+%type <tsym> type_name
/* This is like a '[' token, but is only generated when parsing
Objective C. This lets us reuse the same parser without
%token TEMPLATE
%token ERROR
%token NEW DELETE
-%type <sval> operator
+%type <sval> oper
%token REINTERPRET_CAST DYNAMIC_CAST STATIC_CAST CONST_CAST
%token ENTRY
%token TYPEOF
exp : OBJC_LBRAC TYPENAME
{
- CORE_ADDR class;
+ CORE_ADDR theclass;
- class = lookup_objc_class (parse_gdbarch (pstate),
+ theclass = lookup_objc_class (parse_gdbarch (pstate),
copy_name ($2.stoken));
- if (class == 0)
+ if (theclass == 0)
error (_("%s is not an ObjC Class"),
copy_name ($2.stoken));
write_exp_elt_opcode (pstate, OP_LONG);
write_exp_elt_type (pstate,
parse_type (pstate)->builtin_int);
- write_exp_elt_longcst (pstate, (LONGEST) class);
+ write_exp_elt_longcst (pstate, (LONGEST) theclass);
write_exp_elt_opcode (pstate, OP_LONG);
start_msglist();
}
write_exp_elt_opcode (pstate, OP_LONG);
write_exp_elt_type (pstate,
parse_type (pstate)->builtin_int);
- write_exp_elt_longcst (pstate, (LONGEST) $2.class);
+ write_exp_elt_longcst (pstate, (LONGEST) $2.theclass);
write_exp_elt_opcode (pstate, OP_LONG);
start_msglist();
}
(parse_language (pstate),
parse_gdbarch (pstate),
"int"));
- CHECK_TYPEDEF (type);
+ type = check_typedef (type);
/* $5.3.3/2 of the C++ Standard (n3290 draft)
says of sizeof: "When applied to a reference
qualified_name: TYPENAME COLONCOLON name
{
struct type *type = $1.type;
- CHECK_TYPEDEF (type);
+ type = check_typedef (type);
if (!type_aggregate_p (type))
error (_("`%s' is not defined as an aggregate type."),
TYPE_SAFE_NAME (type));
struct stoken tmp_token;
char *buf;
- CHECK_TYPEDEF (type);
+ type = check_typedef (type);
if (!type_aggregate_p (type))
error (_("`%s' is not defined as an aggregate type."),
TYPE_SAFE_NAME (type));
$2.length);
$$ = NULL;
}
- | UNSIGNED typename
+ | UNSIGNED type_name
{ $$ = lookup_unsigned_typename (parse_language (pstate),
parse_gdbarch (pstate),
TYPE_NAME($2.type)); }
{ $$ = lookup_unsigned_typename (parse_language (pstate),
parse_gdbarch (pstate),
"int"); }
- | SIGNED_KEYWORD typename
+ | SIGNED_KEYWORD type_name
{ $$ = lookup_signed_typename (parse_language (pstate),
parse_gdbarch (pstate),
TYPE_NAME($2.type)); }
{ $$ = follow_types ($1); }
;
-typename: TYPENAME
+type_name: TYPENAME
| INT_KEYWORD
{
$$.stoken.ptr = "int";
{ insert_type (tp_volatile); }
;
-operator: OPERATOR NEW
+oper: OPERATOR NEW
{ $$ = operator_stoken (" new"); }
| OPERATOR DELETE
{ $$ = operator_stoken (" delete"); }
| TYPENAME { $$ = $1.stoken; }
| NAME_OR_INT { $$ = $1.stoken; }
| UNKNOWN_CPP_NAME { $$ = $1.stoken; }
- | operator { $$ = $1; }
+ | oper { $$ = $1; }
;
name_not_typename : NAME
context where only a name could occur, this might be useful.
| NAME_OR_INT
*/
- | operator
+ | oper
{
struct field_of_this_result is_a_field_of_this;
struct token
{
- char *operator;
+ char *oper;
int token;
enum exp_opcode opcode;
enum token_flags flags;
tokstart = lexptr;
/* See if it is a special token of length 3. */
for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
- if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
+ if (strncmp (tokstart, tokentab3[i].oper, 3) == 0)
{
if ((tokentab3[i].flags & FLAG_CXX) != 0
&& parse_language (par_state)->la_language != language_cplus)
/* See if it is a special token of length 2. */
for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
- if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
+ if (strncmp (tokstart, tokentab2[i].oper, 2) == 0)
{
if ((tokentab2[i].flags & FLAG_CXX) != 0
&& parse_language (par_state)->la_language != language_cplus)
/* Catch specific keywords. */
copy = copy_name (yylval.sval);
for (i = 0; i < sizeof ident_tokens / sizeof ident_tokens[0]; i++)
- if (strcmp (copy, ident_tokens[i].operator) == 0)
+ if (strcmp (copy, ident_tokens[i].oper) == 0)
{
if ((ident_tokens[i].flags & FLAG_CXX) != 0
&& parse_language (par_state)->la_language != language_cplus)
CORE_ADDR Class = lookup_objc_class (parse_gdbarch (par_state), copy);
if (Class)
{
- yylval.class.class = Class;
+ yylval.theclass.theclass = Class;
sym = lookup_struct_typedef (copy, expression_context_block, 1);
if (sym)
- yylval.class.type = SYMBOL_TYPE (sym);
+ yylval.theclass.type = SYMBOL_TYPE (sym);
return CLASSNAME;
}
}
return ERROR;
copy = copy_name (yylval.ssym.stoken);
- yylval.ssym.sym = cp_lookup_nested_symbol (type, copy, block);
+ /* N.B. We assume the symbol can only be in VAR_DOMAIN. */
+ yylval.ssym.sym = cp_lookup_nested_symbol (type, copy, block, VAR_DOMAIN);
/* If no symbol was found, search for a matching base class named
COPY. This will allow users to enter qualified names of class members