aboutsummaryrefslogtreecommitdiff
path: root/gdb/parser-defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/parser-defs.h')
-rw-r--r--gdb/parser-defs.h36
1 files changed, 16 insertions, 20 deletions
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index f43fb75..907a798 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -37,14 +37,27 @@ extern int parser_debug;
struct parser_state
{
- /* The expression related to this parser state. */
+ /* Constructor. INITIAL_SIZE is the initial size of the expout
+ array. LANG is the language used to parse the expression. And
+ GDBARCH is the gdbarch to use during parsing. */
+
+ parser_state (size_t initial_size, const struct language_defn *lang,
+ struct gdbarch *gdbarch);
+
+ DISABLE_COPY_AND_ASSIGN (parser_state);
- struct expression *expout;
+ /* Resize the allocated expression to the correct size, and return
+ it as an expression_up -- passing ownership to the caller. */
+ expression_up release ();
/* The size of the expression above. */
size_t expout_size;
+ /* The expression related to this parser state. */
+
+ expression_up expout;
+
/* The number of elements already in the expression. This is used
to know where to put new elements. */
@@ -156,23 +169,6 @@ struct type_stack
int size;
};
-/* Helper function to initialize the expout, expout_size, expout_ptr
- trio inside PS before it is used to store expression elements created
- during the parsing of an expression. INITIAL_SIZE is the initial size of
- the expout array. LANG is the language used to parse the expression.
- And GDBARCH is the gdbarch to use during parsing. */
-
-extern void initialize_expout (struct parser_state *ps,
- size_t initial_size,
- const struct language_defn *lang,
- struct gdbarch *gdbarch);
-
-/* Helper function that reallocates the EXPOUT inside PS in order to
- eliminate any unused space. It is generally used when the expression
- has just been parsed and created. */
-
-extern void reallocate_expout (struct parser_state *ps);
-
/* Reverse an expression from suffix form (in which it is constructed)
to prefix form (in which we can conveniently print or execute it).
Ordinarily this always returns -1. However, if EXPOUT_LAST_STRUCT
@@ -265,7 +261,7 @@ extern struct type *follow_types (struct type *);
extern type_instance_flags follow_type_instance_flags ();
-extern void null_post_parser (struct expression **, int);
+extern void null_post_parser (expression_up *, int);
extern bool parse_float (const char *p, int len,
const struct type *type, gdb_byte *data);