+ /* Constructor. LANG is the language used to parse the expression.
+ And GDBARCH is the gdbarch to use during parsing. */
+
+ parser_state (const struct language_defn *lang,
+ struct gdbarch *gdbarch,
+ const struct block *context_block,
+ CORE_ADDR context_pc,
+ int comma,
+ const char *input,
+ int completion,
+ innermost_block_tracker *tracker)
+ : expr_builder (lang, gdbarch),
+ expression_context_block (context_block),
+ expression_context_pc (context_pc),
+ comma_terminates (comma),
+ lexptr (input),
+ parse_completion (completion),
+ block_tracker (tracker)
+ {
+ }
+
+ DISABLE_COPY_AND_ASSIGN (parser_state);
+
+ /* Begin counting arguments for a function call,
+ saving the data about any containing call. */
+
+ void start_arglist ()
+ {
+ m_funcall_chain.push_back (arglist_len);
+ arglist_len = 0;
+ }
+
+ /* Return the number of arguments in a function call just terminated,
+ and restore the data for the containing function call. */
+
+ int end_arglist ()
+ {
+ int val = arglist_len;
+ arglist_len = m_funcall_chain.back ();
+ m_funcall_chain.pop_back ();
+ return val;
+ }
+
+ /* Mark the current index as the starting location of a structure
+ expression. This is used when completing on field names. */
+
+ void mark_struct_expression ();
+
+ /* Indicate that the current parser invocation is completing a tag.
+ TAG is the type code of the tag, and PTR and LENGTH represent the
+ start of the tag name. */
+
+ void mark_completion_tag (enum type_code tag, const char *ptr, int length);
+
+
+ /* If this is nonzero, this block is used as the lexical context for
+ symbol names. */
+
+ const struct block * const expression_context_block;
+
+ /* If expression_context_block is non-zero, then this is the PC
+ within the block that we want to evaluate expressions at. When
+ debugging C or C++ code, we use this to find the exact line we're
+ at, and then look up the macro definitions active at that
+ point. */
+ const CORE_ADDR expression_context_pc;
+
+ /* Nonzero means stop parsing on first comma (if not within parentheses). */
+
+ int comma_terminates;
+
+ /* During parsing of a C expression, the pointer to the next character
+ is in this variable. */
+
+ const char *lexptr;
+
+ /* After a token has been recognized, this variable points to it.
+ Currently used only for error reporting. */
+ const char *prev_lexptr = nullptr;
+
+ /* Number of arguments seen so far in innermost function call. */
+
+ int arglist_len = 0;
+
+ /* True if parsing an expression to attempt completion. */
+ int parse_completion;
+
+ /* Completion state is updated here. */
+ expr_completion_state m_completion_state;
+
+ /* The innermost block tracker. */
+ innermost_block_tracker *block_tracker;