2013-11-08 08:08:23 +08:00
|
|
|
//===--- QueryParser.h - clang-query ----------------------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08: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 08:08:23 +08: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 22:04:52 +08:00
|
|
|
#include "QuerySession.h"
|
2014-02-01 09:42:46 +08:00
|
|
|
#include "llvm/LineEditor/LineEditor.h"
|
2016-03-18 01:02:25 +08:00
|
|
|
#include <cstddef>
|
2014-02-01 09:42:46 +08:00
|
|
|
|
2013-11-08 08:08:23 +08:00
|
|
|
namespace clang {
|
|
|
|
namespace query {
|
|
|
|
|
2014-02-01 09:42:46 +08:00
|
|
|
class QuerySession;
|
|
|
|
|
|
|
|
class QueryParser {
|
|
|
|
public:
|
2014-03-03 00:48:59 +08:00
|
|
|
/// Parse \a Line as a query.
|
2014-02-01 09:42:46 +08:00
|
|
|
///
|
|
|
|
/// \return A QueryRef representing the query, which may be an InvalidQuery.
|
2014-04-23 22:04:52 +08:00
|
|
|
static QueryRef parse(StringRef Line, const QuerySession &QS);
|
2014-02-01 09:42:46 +08:00
|
|
|
|
2014-03-03 00:48:59 +08: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 09:42:46 +08:00
|
|
|
/// likely to least likely.
|
|
|
|
///
|
2014-03-03 00:48:59 +08:00
|
|
|
/// \return A vector of completions for \a Line.
|
2014-04-23 22:04:52 +08:00
|
|
|
static std::vector<llvm::LineEditor::Completion>
|
|
|
|
complete(StringRef Line, size_t Pos, const QuerySession &QS);
|
2014-02-01 09:42:46 +08:00
|
|
|
|
|
|
|
private:
|
2014-04-23 22:04:52 +08:00
|
|
|
QueryParser(StringRef Line, const QuerySession &QS)
|
2019-01-09 06:27:08 +08:00
|
|
|
: Line(Line), CompletionPos(nullptr), QS(QS) {}
|
2014-02-01 09:42:46 +08:00
|
|
|
|
|
|
|
StringRef lexWord();
|
|
|
|
|
|
|
|
template <typename T> struct LexOrCompleteWord;
|
|
|
|
|
|
|
|
QueryRef parseSetBool(bool QuerySession::*Var);
|
2018-10-30 02:59:56 +08:00
|
|
|
template <typename QueryType> QueryRef parseSetOutputKind();
|
2014-04-23 22:04:52 +08:00
|
|
|
QueryRef completeMatcherExpression();
|
2014-02-01 09:42:46 +08: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 19:32:57 +08:00
|
|
|
/// Parse [\p Begin,\p End).
|
2014-02-01 09:42:46 +08:00
|
|
|
///
|
|
|
|
/// \return A reference to the parsed query object, which may be an
|
|
|
|
/// \c InvalidQuery if a parse error occurs.
|
|
|
|
QueryRef doParse();
|
|
|
|
|
2019-01-09 06:27:08 +08:00
|
|
|
StringRef Line;
|
2014-02-01 09:42:46 +08:00
|
|
|
|
|
|
|
const char *CompletionPos;
|
|
|
|
std::vector<llvm::LineEditor::Completion> Completions;
|
2014-04-23 22:04:52 +08:00
|
|
|
|
|
|
|
const QuerySession &QS;
|
2014-02-01 09:42:46 +08:00
|
|
|
};
|
2013-11-08 08:08:23 +08:00
|
|
|
|
|
|
|
} // namespace query
|
|
|
|
} // namespace clang
|
|
|
|
|
2016-03-18 01:02:25 +08:00
|
|
|
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_QUERY_QUERY_PARSER_H
|