summaryrefslogtreecommitdiff
path: root/gdb/parser-defs.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-07-06 14:44:21 +0000
committerTom Tromey <tromey@redhat.com>2012-07-06 14:44:21 +0000
commit42ad8e35a1273caaefa962edf8324845445218c1 (patch)
tree5aaf26bc2898e7ff1ad870cd54f7f5c6bd8bb0f1 /gdb/parser-defs.h
parent706bd692c053fdd1fd084e5aca0bbf13764bd0e6 (diff)
downloadgdb-42ad8e35a1273caaefa962edf8324845445218c1.tar.gz
* c-exp.y (%union) <type_stack>: New field.
(abs_decl, direct_abs_decl): Use <type_stack> type. Update. (ptr_operator_ts): New production. (ptype): Update. * parse.c (type_stack_reserve): New function. (check_type_stack_depth): Use it. (pop_type_stack, append_type_stack, push_type_stack) (get_type_stack, type_stack_cleanup): New functions. (follow_types): Handle tp_type_stack. (_initialize_parse): Simplify initialization. * parser-defs.h (enum type_pieces) <tp_type_stack>: New constant. (union type_stack_elt) <stack_val>: New field. (get_type_stack, append_type_stack, push_type_stack) (type_stack_cleanup): Declare. testsuite * gdb.base/whatis.exp: Add tests.
Diffstat (limited to 'gdb/parser-defs.h')
-rw-r--r--gdb/parser-defs.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index de283d04fbd..06491893ddc 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -119,13 +119,15 @@ enum type_pieces
tp_function,
tp_const,
tp_volatile,
- tp_space_identifier
+ tp_space_identifier,
+ tp_type_stack
};
/* The stack can contain either an enum type_pieces or an int. */
union type_stack_elt
{
enum type_pieces piece;
int int_val;
+ struct type_stack *stack_val;
};
/* The type stack is an instance of this structure. */
@@ -214,6 +216,15 @@ extern enum type_pieces pop_type (void);
extern int pop_type_int (void);
+extern struct type_stack *get_type_stack (void);
+
+extern struct type_stack *append_type_stack (struct type_stack *to,
+ struct type_stack *from);
+
+extern void push_type_stack (struct type_stack *stack);
+
+extern void type_stack_cleanup (void *arg);
+
extern int length_of_subexp (struct expression *, int);
extern int dump_subexp (struct expression *, struct ui_file *, int);