diff options
author | Per Bothner <per@bothner.com> | 1995-06-14 19:59:35 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1995-06-14 19:59:35 +0000 |
commit | 6137983598c57aa8557001079b10fa3be8b77ef6 (patch) | |
tree | ffe6a013f33ab7bb0d0d01f7aa68f8c344107208 /gdb/m2-lang.c | |
parent | 69cb5925c9f6146f2ca098cc23e209f00683d61d (diff) | |
download | gdb-6137983598c57aa8557001079b10fa3be8b77ef6.zip gdb-6137983598c57aa8557001079b10fa3be8b77ef6.tar.gz gdb-6137983598c57aa8557001079b10fa3be8b77ef6.tar.bz2 |
* parser-defs.h (enum precedence): Added PREC_BUILTIN_FUNCTION.
* expression.h (enum exp_opcode): Added UNOP_LOWER, UNOP_UPPER,
UNUP_LENGTH.
* expprint.c (dump_expression): Handle the new exp_opcodes.
(print_subexp): Handle PREC_BUILTIN_FUNCTION.
(print_simple_m2_func): Removed.
(print_subexp): Remove support for Modula2 builtin functions.
* m2-lang.c (m2_op_print_tab): Add support for builtin functions.
* ch-exp.y: Parse LOWER, UPPER, and LENGTH builtins.
(write_lower_upper_value): Convenience function for LOWER and UPPER.
(upper_lower_argument, length_argument): Removed non-terminals.
* ch-lang.c (chill_op_print_tab): Entries for UPPER, LOWER, LENGTH.
(type_lower_upper): New function. Calculate LOWER/UPPER of type.
(value_chill_length): New function. Calcalate LENGTH of ARRAY/STRING.
(evaluate_subexp_chill): Handle UNOP_LOWER, UNOP_UPPER, UNOP_LENGTH.
This fixes PR 5015 (and 5826 which is a duplicate).
Diffstat (limited to 'gdb/m2-lang.c')
-rw-r--r-- | gdb/m2-lang.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index 1a7fd6d..4eac7e6 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -378,6 +378,15 @@ static const struct op_print m2_op_print_tab[] = { {"<", BINOP_LESS, PREC_ORDER, 0}, {"^", UNOP_IND, PREC_PREFIX, 0}, {"@", BINOP_REPEAT, PREC_REPEAT, 0}, + {"CAP", UNOP_CAP, PREC_BUILTIN_FUNCTION, 0}, + {"CHR", UNOP_CHR, PREC_BUILTIN_FUNCTION, 0}, + {"ORD", UNOP_ORD, PREC_BUILTIN_FUNCTION, 0}, + {"FLOAT",UNOP_FLOAT, PREC_BUILTIN_FUNCTION, 0}, + {"HIGH", UNOP_HIGH, PREC_BUILTIN_FUNCTION, 0}, + {"MAX", UNOP_MAX, PREC_BUILTIN_FUNCTION, 0}, + {"MIN", UNOP_MIN, PREC_BUILTIN_FUNCTION, 0}, + {"ODD", UNOP_ODD, PREC_BUILTIN_FUNCTION, 0}, + {"TRUNC", UNOP_TRUNC, PREC_BUILTIN_FUNCTION, 0}, {NULL, 0, 0, 0} }; |