diff options
author | Gaius Mulley <gaius@glam.ac.uk> | 2007-10-16 17:36:51 +0000 |
---|---|---|
committer | Gaius Mulley <gaius@glam.ac.uk> | 2007-10-16 17:36:51 +0000 |
commit | 844781a1bed001865515739fc576c268af2127d6 (patch) | |
tree | 1a3131da91b80cb47448da1be3e35db0d7b8d8f7 /gdb/m2-exp.y | |
parent | e831e7b6ed2afd432c9791873284b5a1db9c5b97 (diff) | |
download | gdb-844781a1bed001865515739fc576c268af2127d6.zip gdb-844781a1bed001865515739fc576c268af2127d6.tar.gz gdb-844781a1bed001865515739fc576c268af2127d6.tar.bz2 |
* 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.y | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index 201ba82..7bcde3b 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 }, }; |