summaryrefslogtreecommitdiff
path: root/gdb/m2-exp.y
diff options
context:
space:
mode:
authorGaius Mulley <gaius@glam.ac.uk>2007-10-16 17:36:51 +0000
committerGaius Mulley <gaius@glam.ac.uk>2007-10-16 17:36:51 +0000
commit0a3e31a04b713436fbd036bca000baf20ded9978 (patch)
tree50d67d084464380b91fb17ddc2c42b7d826f672c /gdb/m2-exp.y
parent561d0b4d163aeec64cecbe50e90e7c30dea6bdf2 (diff)
downloadgdb-0a3e31a04b713436fbd036bca000baf20ded9978.tar.gz
* doc/gdb.texinfo: Add TSIZE definition, removed
statement about unbounded arrays being unimplemented. * m2-valprint.c (m2_print_array_contents): New function. (m2_print_unbounded_array): New function. (m2_print_array_contents): New function. * m2-typeprint.c (m2_unbounded_array): New function. (m2_is_unbounded_array): New function. (m2_print_type): Test for unbounded array when walking across structs. * m2-lang.h: Added extern m2_is_unbounded_array. * m2-lang.c (evaluate_subexp_modula2): New function. (exp_descriptor_modula2): New structure. (m2_language_defn): Use exp_descriptor_modula2. * m2-exp.y: Added TSIZE and binary subscript.
Diffstat (limited to 'gdb/m2-exp.y')
-rw-r--r--gdb/m2-exp.y10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index 201ba822399..7bcde3b1af7 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -174,6 +174,7 @@ static struct block *modblock=0;
%token <sval> TYPENAME
%token SIZE CAP ORD HIGH ABS MIN_FUNC MAX_FUNC FLOAT_FUNC VAL CHR ODD TRUNC
+%token TSIZE
%token INC DEC INCL EXCL
/* The GDB scope operator */
@@ -288,6 +289,10 @@ exp : TRUNC '(' exp ')'
{ write_exp_elt_opcode (UNOP_TRUNC); }
;
+exp : TSIZE '(' exp ')'
+ { write_exp_elt_opcode (UNOP_SIZEOF); }
+ ;
+
exp : SIZE exp %prec UNARY
{ write_exp_elt_opcode (UNOP_SIZEOF); }
;
@@ -353,6 +358,10 @@ exp : exp '['
write_exp_elt_opcode (MULTI_SUBSCRIPT); }
;
+exp : exp '[' exp ']'
+ { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
+ ;
+
exp : exp '('
/* This is to save the value of arglist_len
being accumulated by an outer function call. */
@@ -809,6 +818,7 @@ static struct keyword keytab[] =
{"SIZE", SIZE },
{"FLOAT", FLOAT_FUNC },
{"TRUNC", TRUNC },
+ {"TSIZE", SIZE },
};