aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1993-02-03 00:28:54 +0000
committerFred Fish <fnf@specifix.com>1993-02-03 00:28:54 +0000
commit9da75ad32ed2e8a5e8dad4ef019d7c31fe8c209e (patch)
tree556f55195aa13b08e730abce9b4d876388da1866 /gdb/c-exp.y
parent58bcc08c6024f31c1f495ec2cdcd3248daee1930 (diff)
downloadgdb-9da75ad32ed2e8a5e8dad4ef019d7c31fe8c209e.zip
gdb-9da75ad32ed2e8a5e8dad4ef019d7c31fe8c209e.tar.gz
gdb-9da75ad32ed2e8a5e8dad4ef019d7c31fe8c209e.tar.bz2
* c-exp.y (lcurly, rcurly): New nonterminals.
* c-exp.y (exp): Use lcurly and rcurly for arrays and UNOP_MEMVAL constructs. * parse.c (free_funcalls): Moved prototype from parser-defs.h, made function static. * parse.c (struct funcall): Moved struct def from parser-defs.h. * parse.c (funcall_chain): Moved from parser-defs.h, made static. * parse.c (start_arglist): * parser-defs.h (free_funcalls): Moved prototype to parse.c. * parser-defs.h (struct funcall): Moved struct def to parse.c. * parser-defs.h (funcall_chain): Moved to parse.c. * printcmd.c (print_frame_nameless_args): Fix prototype. * tm-mips.h (setup_arbitrary_frame): Fix prototype. * tm-sparc.h (setup_arbitrary_frame): Fix prototype. * valops.c (typecmp): Moved prototype from values.h. * value.h (typecmp): Moved prototype to valops.c, made static. **** start-sanitize-chill **** * ch-exp.y (yylex): Change way control sequences are disabled. **** end-sanitize-chill ****
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y20
1 files changed, 12 insertions, 8 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index a7f7320..981634a 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -128,7 +128,8 @@ static int
parse_number PARAMS ((char *, int, int, YYSTYPE *));
%}
-%type <voidval> exp exp1 type_exp start variable qualified_name
+%type <voidval> exp exp1 type_exp start variable qualified_name lcurly
+%type <lval> rcurly
%type <tval> type typebase
%type <tvec> nonempty_typelist
/* %type <bval> block */
@@ -307,6 +308,10 @@ exp : exp '('
write_exp_elt_opcode (OP_FUNCALL); }
;
+lcurly : '{'
+ { start_arglist (); }
+ ;
+
arglist :
;
@@ -318,18 +323,17 @@ arglist : arglist ',' exp %prec ABOVE_COMMA
{ arglist_len++; }
;
-exp : '{'
- /* This is to save the value of arglist_len
- being accumulated by an outer function call. */
- { start_arglist (); }
- arglist '}' %prec ARROW
+rcurly : '}'
+ { $$ = end_arglist () - 1; }
+ ;
+exp : lcurly arglist rcurly %prec ARROW
{ write_exp_elt_opcode (OP_ARRAY);
write_exp_elt_longcst ((LONGEST) 0);
- write_exp_elt_longcst ((LONGEST) end_arglist () - 1);
+ write_exp_elt_longcst ((LONGEST) $3);
write_exp_elt_opcode (OP_ARRAY); }
;
-exp : '{' type '}' exp %prec UNARY
+exp : lcurly type rcurly exp %prec UNARY
{ write_exp_elt_opcode (UNOP_MEMVAL);
write_exp_elt_type ($2);
write_exp_elt_opcode (UNOP_MEMVAL); }