From 9da75ad32ed2e8a5e8dad4ef019d7c31fe8c209e Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Wed, 3 Feb 1993 00:28:54 +0000 Subject: * 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 **** --- gdb/c-exp.y | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'gdb/c-exp.y') 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 exp exp1 type_exp start variable qualified_name +%type exp exp1 type_exp start variable qualified_name lcurly +%type rcurly %type type typebase %type nonempty_typelist /* %type 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); } -- cgit v1.1