diff options
author | Fred Fish <fnf@specifix.com> | 1993-01-02 20:32:01 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1993-01-02 20:32:01 +0000 |
commit | 54bbbfb43300a2ca9ef3509e9076caa1776970d1 (patch) | |
tree | 86109f7c0f1730cf10d8332153359774397ea0cf /gdb/ch-exp.y | |
parent | ea81b10d1eb802c8270a758d5f6017b56e3388ca (diff) | |
download | gdb-54bbbfb43300a2ca9ef3509e9076caa1776970d1.zip gdb-54bbbfb43300a2ca9ef3509e9076caa1776970d1.tar.gz gdb-54bbbfb43300a2ca9ef3509e9076caa1776970d1.tar.bz2 |
* 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 ****
Diffstat (limited to 'gdb/ch-exp.y')
-rw-r--r-- | gdb/ch-exp.y | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/gdb/ch-exp.y b/gdb/ch-exp.y index 7987113..e330a9f 100644 --- a/gdb/ch-exp.y +++ b/gdb/ch-exp.y @@ -326,6 +326,17 @@ access_name : LOCATION_NAME } ; +/* Z.200, 4.2.8 */ + +expression_list : expression + { + arglist_len = 1; + } + | expression_list ',' expression + { + arglist_len++; + } + /* Z.200, 5.2.1 */ primitive_value : location_contents @@ -495,9 +506,15 @@ value_string_slice: string_primitive_value '(' left_element ':' right_element ') /* Z.200, 5.2.8 */ -value_array_element: array_primitive_value '(' expression_list ')' +value_array_element: array_primitive_value '(' + /* This is to save the value of arglist_len + being accumulated for each dimension. */ + { start_arglist (); } + expression_list ')' { - $$ = 0; /* FIXME */ + write_exp_elt_opcode (MULTI_SUBSCRIPT); + write_exp_elt_longcst ((LONGEST) end_arglist ()); + write_exp_elt_opcode (MULTI_SUBSCRIPT); } ; @@ -793,7 +810,16 @@ integer_literal_expression: $$ = 0; } +/* Z.200, 12.4.3 */ + +array_primitive_value : primitive_value + { + $$ = 0; + } + + /* Things which still need productions... */ + synonym_name : FIXME { $$ = 0; } value_enumeration_name : FIXME { $$ = 0; } value_do_with_name : FIXME { $$ = 0; } @@ -803,8 +829,6 @@ start_element : FIXME { $$ = 0; } left_element : FIXME { $$ = 0; } right_element : FIXME { $$ = 0; } slice_size : FIXME { $$ = 0; } -array_primitive_value : FIXME { $$ = 0; } -expression_list : FIXME { $$ = 0; } lower_element : FIXME { $$ = 0; } upper_element : FIXME { $$ = 0; } first_element : FIXME { $$ = 0; } @@ -1304,6 +1328,7 @@ yylex () { case '\0': return (0); + case ',': case '.': case '=': case ';': |