aboutsummaryrefslogtreecommitdiff
path: root/gdb/ch-exp.y
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1993-01-05 01:18:07 +0000
committerFred Fish <fnf@specifix.com>1993-01-05 01:18:07 +0000
commit76a0ffb47b50a3c7918eb93b4f5c5871ccdf31ef (patch)
treeffdf3c6d4491f86859a5b03b83d52d2a8f87d10f /gdb/ch-exp.y
parentdb81c5e7d5f9e90fa76f8783d25142976e842bdc (diff)
downloadgdb-76a0ffb47b50a3c7918eb93b4f5c5871ccdf31ef.zip
gdb-76a0ffb47b50a3c7918eb93b4f5c5871ccdf31ef.tar.gz
gdb-76a0ffb47b50a3c7918eb93b4f5c5871ccdf31ef.tar.bz2
* expression.h (exp_opcode): Add BINOP_MOD.
* eval.c (evaluate_subexp): Handle new BINOP_MOD. * expprint.c (dump_expression): Handle new BINOP_MOD. * language.c (binop_type_check): Handle new BINOP_MOD. * main.c (float_handler): Re-enable float handler when hit. * valarith.c (language.h): Include, need current_language. * valarith.c (TRUNCATION_TOWARDS_ZERO): Define default macro for integer divide truncates towards zero for negative results. * valarith.c (value_x_binop): Handle BINOP_MOD if seen. * valarith.c (value_binop): Allow arithmetic operations on TYPE_CODE_CHAR variables. Add case to handle new BINOP_MOD. **** start-sanitize-chill **** * ch-exp.y (operand_4): Add useful actions for MOD and REM. * ch-exp.y (tokentab3): Add MOD and REM. * ch-exp.y (yylex): Set innermost_block for symbols found in local scopes. Return LOCATION_NAME for local symbols. * ch-lang.c (chill_op_print_tab): Fix MOD entry to use BINOP_MOD instead of BINOP_REM. Add REM entry, using BINOP_REM. **** end-sanitize-chill ****
Diffstat (limited to 'gdb/ch-exp.y')
-rw-r--r--gdb/ch-exp.y24
1 files changed, 18 insertions, 6 deletions
diff --git a/gdb/ch-exp.y b/gdb/ch-exp.y
index 6d6ebe7..38211d2 100644
--- a/gdb/ch-exp.y
+++ b/gdb/ch-exp.y
@@ -757,11 +757,11 @@ operand_4 : operand_5
}
| operand_4 MOD operand_5
{
- $$ = 0; /* FIXME */
+ write_exp_elt_opcode (BINOP_MOD);
}
| operand_4 REM operand_5
{
- $$ = 0; /* FIXME */
+ write_exp_elt_opcode (BINOP_REM);
}
;
@@ -1390,6 +1390,8 @@ static const struct token tokentab4[] =
static const struct token tokentab3[] =
{
+ { "MOD", MOD },
+ { "REM", REM },
{ "NOT", NOT },
{ "XOR", LOGXOR },
{ "AND", LOGAND }
@@ -1564,17 +1566,27 @@ yylex ()
case LOC_STATIC:
/* Found a global or local static variable. */
return (LOCATION_NAME);
- case LOC_UNDEF:
- case LOC_CONST:
case LOC_REGISTER:
case LOC_ARG:
case LOC_REF_ARG:
case LOC_REGPARM:
case LOC_LOCAL:
- case LOC_TYPEDEF:
+ case LOC_LOCAL_ARG:
+ if (innermost_block == NULL
+ || contained_in (block_found, innermost_block))
+ {
+ innermost_block = block_found;
+ }
+ return (LOCATION_NAME);
+ break;
+ case LOC_CONST:
case LOC_LABEL:
+ return (LOCATION_NAME);
+ break;
+ case LOC_UNDEF:
+ case LOC_TYPEDEF:
case LOC_CONST_BYTES:
- case LOC_LOCAL_ARG:
+ error ("Symbol \"%s\" names no location.", simplename);
break;
}
}