* 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 ****
This commit is contained in:
Fred Fish 1993-02-03 00:28:54 +00:00
parent 58bcc08c60
commit 9da75ad32e
7 changed files with 61 additions and 27 deletions

View File

@ -1,3 +1,25 @@
Tue Feb 2 16:10:31 1993 Fred Fish (fnf@cygnus.com)
* 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 ****
Tue Feb 2 16:11:43 1993 John Gilmore (gnu@cygnus.com)
* tm-mips.h, tm-sparc.h: Fix thinko in SETUP_ARBITRARY_FRAME.

View File

@ -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); }

View File

@ -1420,7 +1420,7 @@ match_character_literal ()
if ((*tokptr == '^') && (*(tokptr + 1) == '('))
{
return (0); /* Disable, see note above. */
#if 0 /* Disable, see note above. -fnf */
/* Match and decode a control sequence. Return zero if we don't
find a valid integer literal, or if the next unconsumed character
after the integer literal is not the trailing ')'.
@ -1431,6 +1431,9 @@ match_character_literal ()
{
return (0);
}
#else
return (0);
#endif
}
else
{

View File

@ -38,6 +38,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "language.h"
#include "parser-defs.h"
static void
free_funcalls PARAMS ((void));
static void
prefixify_expression PARAMS ((struct expression *));
@ -47,6 +50,17 @@ length_of_subexp PARAMS ((struct expression *, int));
static void
prefixify_subexp PARAMS ((struct expression *, struct expression *, int, int));
/* Data structure for saving values of arglist_len for function calls whose
arguments contain other function calls. */
struct funcall
{
struct funcall *next;
int arglist_len;
};
static struct funcall *funcall_chain;
/* Assign machine-independent names to certain registers
(unless overridden by the REGISTER_NAMES table) */
@ -82,8 +96,9 @@ unsigned num_std_regs = (sizeof std_regs / sizeof std_regs[0]);
void
start_arglist ()
{
register struct funcall *new = (struct funcall *) xmalloc (sizeof (struct funcall));
register struct funcall *new;
new = (struct funcall *) xmalloc (sizeof (struct funcall));
new->next = funcall_chain;
new->arglist_len = arglist_len;
arglist_len = 0;
@ -107,7 +122,7 @@ end_arglist ()
/* Free everything in the funcall chain.
Used when there is an error inside parsing. */
void
static void
free_funcalls ()
{
register struct funcall *call, *next;

View File

@ -49,17 +49,6 @@ struct block *block_found;
/* Number of arguments seen so far in innermost function call. */
int arglist_len;
/* Data structure for saving values of arglist_len
for function calls whose arguments contain other function calls. */
struct funcall
{
struct funcall *next;
int arglist_len;
};
struct funcall *funcall_chain;
/* A string token, either a char-string or bit-string. Char-strings are
used, for example, for the names of symbols. */
@ -129,9 +118,6 @@ start_arglist PARAMS ((void));
extern int
end_arglist PARAMS ((void));
extern void
free_funcalls PARAMS ((void));
extern char *
copy_name PARAMS ((struct stoken));

View File

@ -367,6 +367,8 @@ typedef struct mips_extra_func_info {
multiple functions with the same SP that are at different stack levels. */
#define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
extern struct frame_info *setup_arbitrary_frame ();
/* FIXME: Depends on equivalence between FRAME and "struct frame_info *",
and equivalence between CORE_ADDR and FRAME_ADDR. */
extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *));
#define STAB_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32)

View File

@ -552,7 +552,9 @@ extern void single_step ();
"frame" or "info frame" command. */
#define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
extern struct frame_info *setup_arbitrary_frame ();
/* FIXME: Depends on equivalence between FRAME and "struct frame_info *",
and equivalence between CORE_ADDR and FRAME_ADDR. */
extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *));
/* To print every pair of float registers as a double, we use this hook. */