From c66ed94ae961c19b0d3028489d00a2df5a949aac Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 22 Feb 2022 11:18:01 -0700 Subject: Implement completion for Ada attributes This adds a completer for Ada attributes. Some work in the lexer is required in order to match end-of-input correctly, as flex does not have a general-purpose way of doing this. (The approach taken here is recommended in the flex manual.) --- gdb/parser-defs.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gdb/parser-defs.h') diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h index 71381b1..3be7d6c 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -195,6 +195,14 @@ struct parser_state : public expr_builder void mark_completion_tag (enum type_code tag, const char *ptr, int length); + /* Mark for completion, using an arbitrary completer. */ + + void mark_completion (std::unique_ptr completer) + { + gdb_assert (m_completion_state == nullptr); + m_completion_state = std::move (completer); + } + /* Push an operation on the stack. */ void push (expr::operation_up &&op) { -- cgit v1.1