* eval.c (evaluate_subexp): Add case MULTI_SUBSCRIPT.

* expprint.c (print_subexp):  Rename BINOP_MULTI_SUBSCRIPT to
	MULTI_SUBSCRIPT.
	* expprint.c (dump_expression):  New function for dumping
	expression vectors during gdb debugging.
	* expression.h (BINOP_MULTI_SUBSCRIPT):  Name changed to
	MULTI_SUBSCRIPT and moved out of BINOP range.
	* expression.h (DUMP_EXPRESSION):  New macro that calls
	dump_expression if DEBUG_EXPRESSIONS is defined.
	* m2-exp.y (BINOP_MULTI_SUBSCRIPT):  Changed to MULTI_SUBSCRIPT.
	* parse.c (length_of_subexp, prefixify_subexp):  Change
	BINOP_MULTI_SUBSCRIPT to MULTI_SUBSCRIPT.
	* parse.c (parse_exp_1):  Call DUMP_EXPRESSION before and after
	prefixify'ing the expression.
	* printcmd.c (print_command_1):  Add comment.
	**** start-sanitize-chill ****
	* ch-exp.y (expression_list):  Add useful actions.
	* ch-exp.y (value_array_element):  Add useful actions.
	* ch-exp.y (array_primitive_value):  Add production.
	* ch-exp.y (yylex):  Recognize ',' as a token.
	**** end-sanitize-chill ****
This commit is contained in:
Fred Fish
1993-01-02 20:32:01 +00:00
parent ea81b10d1e
commit 54bbbfb433
7 changed files with 280 additions and 22 deletions

View File

@@ -376,7 +376,7 @@ length_of_subexp (expr, endpos)
break;
/* Modula-2 */
case BINOP_MULTI_SUBSCRIPT:
case MULTI_SUBSCRIPT:
oplen=3;
args = 1 + longest_to_int (expr->elts[endpos- 2].longconst);
break;
@@ -498,7 +498,7 @@ prefixify_subexp (inexpr, outexpr, inend, outbeg)
break;
/* Modula-2 */
case BINOP_MULTI_SUBSCRIPT:
case MULTI_SUBSCRIPT:
oplen=3;
args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst);
break;
@@ -591,12 +591,24 @@ parse_exp_1 (stringptr, block, comma)
current_language->la_error (NULL);
discard_cleanups (old_chain);
/* Record the actual number of expression elements, and then
reallocate the expression memory so that we free up any
excess elements. */
expout->nelts = expout_ptr;
expout = (struct expression *)
xrealloc ((char *) expout,
sizeof (struct expression)
+ expout_ptr * sizeof (union exp_element));
/* Convert expression from postfix form as generated by yacc
parser, to a prefix form. */
DUMP_EXPRESSION (expout, stdout, "before conversion to prefix form");
prefixify_expression (expout);
DUMP_EXPRESSION (expout, stdout, "after conversion to prefix form");
*stringptr = lexptr;
return expout;
}