2013-11-08 00:08:23 +00:00
|
|
|
//===--- QueryParser.h - clang-query ----------------------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 08:50:56 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2013-11-08 00:08:23 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_PARSER_H
|
|
|
|
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_PARSER_H
|
|
|
|
|
|
|
|
#include "Query.h"
|
2014-04-23 14:04:52 +00:00
|
|
|
#include "QuerySession.h"
|
2014-02-01 01:42:46 +00:00
|
|
|
#include "llvm/LineEditor/LineEditor.h"
|
2016-03-17 17:02:25 +00:00
|
|
|
#include <cstddef>
|
2014-02-01 01:42:46 +00:00
|
|
|
|
2013-11-08 00:08:23 +00:00
|
|
|
namespace clang {
|
|
|
|
namespace query {
|
|
|
|
|
2014-02-01 01:42:46 +00:00
|
|
|
class QuerySession;
|
|
|
|
|
|
|
|
class QueryParser {
|
|
|
|
public:
|
2014-03-02 16:48:59 +00:00
|
|
|
/// Parse \a Line as a query.
|
2014-02-01 01:42:46 +00:00
|
|
|
///
|
|
|
|
/// \return A QueryRef representing the query, which may be an InvalidQuery.
|
2014-04-23 14:04:52 +00:00
|
|
|
static QueryRef parse(StringRef Line, const QuerySession &QS);
|
2014-02-01 01:42:46 +00:00
|
|
|
|
2014-03-02 16:48:59 +00:00
|
|
|
/// Compute a list of completions for \a Line assuming a cursor at
|
|
|
|
/// \param Pos characters past the start of \a Line, ordered from most
|
2014-02-01 01:42:46 +00:00
|
|
|
/// likely to least likely.
|
|
|
|
///
|
2014-03-02 16:48:59 +00:00
|
|
|
/// \return A vector of completions for \a Line.
|
2014-04-23 14:04:52 +00:00
|
|
|
static std::vector<llvm::LineEditor::Completion>
|
|
|
|
complete(StringRef Line, size_t Pos, const QuerySession &QS);
|
2014-02-01 01:42:46 +00:00
|
|
|
|
|
|
|
private:
|
2014-04-23 14:04:52 +00:00
|
|
|
QueryParser(StringRef Line, const QuerySession &QS)
|
2019-01-08 22:27:08 +00:00
|
|
|
: Line(Line), CompletionPos(nullptr), QS(QS) {}
|
2014-02-01 01:42:46 +00:00
|
|
|
|
|
|
|
StringRef lexWord();
|
|
|
|
|
|
|
|
template <typename T> struct LexOrCompleteWord;
|
|
|
|
|
|
|
|
QueryRef parseSetBool(bool QuerySession::*Var);
|
2020-12-11 00:52:35 +01:00
|
|
|
QueryRef parseSetTraversalKind(TraversalKind QuerySession::*Var);
|
2018-10-29 18:59:56 +00:00
|
|
|
template <typename QueryType> QueryRef parseSetOutputKind();
|
2014-04-23 14:04:52 +00:00
|
|
|
QueryRef completeMatcherExpression();
|
2014-02-01 01:42:46 +00:00
|
|
|
|
|
|
|
QueryRef endQuery(QueryRef Q);
|
|
|
|
|
Remove \brief commands from doxygen comments.
Summary:
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.
Patch produced by
for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
[This is analogous to LLVM r331272 and CFE r331834]
Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66578
llvm-svn: 369643
2019-08-22 11:32:57 +00:00
|
|
|
/// Parse [\p Begin,\p End).
|
2014-02-01 01:42:46 +00:00
|
|
|
///
|
|
|
|
/// \return A reference to the parsed query object, which may be an
|
|
|
|
/// \c InvalidQuery if a parse error occurs.
|
|
|
|
QueryRef doParse();
|
|
|
|
|
2019-01-08 22:27:08 +00:00
|
|
|
StringRef Line;
|
2014-02-01 01:42:46 +00:00
|
|
|
|
|
|
|
const char *CompletionPos;
|
|
|
|
std::vector<llvm::LineEditor::Completion> Completions;
|
2014-04-23 14:04:52 +00:00
|
|
|
|
|
|
|
const QuerySession &QS;
|
2014-02-01 01:42:46 +00:00
|
|
|
};
|
2013-11-08 00:08:23 +00:00
|
|
|
|
|
|
|
} // namespace query
|
|
|
|
} // namespace clang
|
|
|
|
|
2016-03-17 17:02:25 +00:00
|
|
|
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_PARSER_H
|